# HG changeset patch # User Shinji KONO # Date 1626691681 -32400 # Node ID 9e61cd3a874dccefe1692ae29aa5c21c5a65d4cd # Parent cf4f212398d789680a3579323fafe1c0a44ca936 MCDPP worked diff -r cf4f212398d7 -r 9e61cd3a874d clang/lib/Parse/ParseCbC.cpp --- a/clang/lib/Parse/ParseCbC.cpp Mon Jul 19 09:08:46 2021 +0900 +++ b/clang/lib/Parse/ParseCbC.cpp Mon Jul 19 19:48:01 2021 +0900 @@ -1166,6 +1166,9 @@ } } +// +// you may get Actions.getASTContext(). +// std::string get_string(const Expr *expr, const ASTContext &Context) { PrintingPolicy print_policy(Context.getLangOpts()); print_policy.FullyQualifiedName = 1; diff -r cf4f212398d7 -r 9e61cd3a874d clang/lib/Parse/ParseDecl.cpp --- a/clang/lib/Parse/ParseDecl.cpp Mon Jul 19 09:08:46 2021 +0900 +++ b/clang/lib/Parse/ParseDecl.cpp Mon Jul 19 19:48:01 2021 +0900 @@ -4958,6 +4958,9 @@ case tok::kw__Complex: case tok::kw__Imaginary: case tok::kw_void: +#ifndef noCbC + case tok::kw___code: +#endif case tok::kw_char: case tok::kw_wchar_t: case tok::kw_char8_t: @@ -5039,6 +5042,9 @@ case tok::kw__Complex: case tok::kw__Imaginary: case tok::kw_void: +#ifndef noCbC + case tok::kw___code: +#endif case tok::kw_char: case tok::kw_wchar_t: case tok::kw_char8_t: @@ -5206,6 +5212,9 @@ case tok::kw__Complex: case tok::kw__Imaginary: case tok::kw_void: +#ifndef noCbC + case tok::kw___code: +#endif case tok::kw_char: case tok::kw_wchar_t: case tok::kw_char8_t: @@ -7347,6 +7356,9 @@ case tok::kw_signed: case tok::kw_unsigned: case tok::kw_void: +#ifndef noCbC + case tok::kw___code: +#endif case tok::kw_char: case tok::kw_int: case tok::kw_float: @@ -7383,6 +7395,9 @@ case tok::kw_signed: case tok::kw_unsigned: case tok::kw_void: +#ifndef noCbC + case tok::kw___code: +#endif case tok::kw_char: case tok::kw_int: case tok::kw_float: diff -r cf4f212398d7 -r 9e61cd3a874d clang/lib/Parse/ParseExpr.cpp --- a/clang/lib/Parse/ParseExpr.cpp Mon Jul 19 09:08:46 2021 +0900 +++ b/clang/lib/Parse/ParseExpr.cpp Mon Jul 19 19:48:01 2021 +0900 @@ -935,6 +935,9 @@ // break out of the switch; at the end we call ParsePostfixExpressionSuffix // to handle the postfix expression suffixes. Cases that cannot be followed // by postfix exprs should set AllowSuffix to false. + if (SavedKind == tok::kw_void) { + NotCastExpr = false; + } switch (SavedKind) { case tok::l_paren: { // If this expression is limited to being a unary-expression, the paren can @@ -1528,9 +1531,6 @@ case tok::kw__Float16: case tok::kw___float128: case tok::kw_void: -#ifndef noCbC - case tok::kw___code: -#endif case tok::kw_typename: case tok::kw_typeof: case tok::kw___vector: