aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
diff options
context:
space:
mode:
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>2023-07-03 05:34:12 -0400
committerMariya Podchishchaeva <mariya.podchishchaeva@intel.com>2023-07-03 06:07:04 -0400
commit4a792e06e8e72f4c14e5a5251e71051d7a984820 (patch)
tree0dae866ef618e348ee60e5dc388beba7d7c6a69d /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
parentfc5a5794ab5682f8b2052639fe5845cc5e7da593 (diff)
downloadllvm-4a792e06e8e72f4c14e5a5251e71051d7a984820.zip
llvm-4a792e06e8e72f4c14e5a5251e71051d7a984820.tar.gz
llvm-4a792e06e8e72f4c14e5a5251e71051d7a984820.tar.bz2
[clang] Fix new-expression with elaborated-type-specifier
Expressions like ``` struct A {}; ... new struct A {}; struct A* b = (1 == 1) ? new struct A : new struct A; ``` were parsed as redefinitions of `struct A` and failed, however as clarified by `CWG2141` new-expression cannot define a type, so both these examples should be considered as references to the previously declared `struct A`. The patch adds a "new" kind context for parsing declaration specifiers in addition to already existing declarator context in order to track that the parser is inside of a new expression. Fixes https://github.com/llvm/llvm-project/issues/34341 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D153857
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions