diff options
author | Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> | 2023-07-03 05:34:12 -0400 |
---|---|---|
committer | Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> | 2023-07-03 06:07:04 -0400 |
commit | 4a792e06e8e72f4c14e5a5251e71051d7a984820 (patch) | |
tree | 0dae866ef618e348ee60e5dc388beba7d7c6a69d /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | |
parent | fc5a5794ab5682f8b2052639fe5845cc5e7da593 (diff) | |
download | llvm-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