[PATCH] D153857: [clang] Fix new-expression with elaborated-type-specifier

Mariya Podchishchaeva via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 27 12:18:52 PDT 2023


Fznamznon added a comment.

> With code like struct A {}; <and the rest of your example>, the expressions were parsed as redefining struct A and failed. However, as clarified by CWG2141, new-expression cannot define a type, so both these expressions should be considered as valid references to the previously declared struct A.

Sure, thank you and sorry for the confusion! I should have added `struct A {};` to the example in the first place.

> I think the root cause of that issue is that we don't implement DR2141 (https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2141); are you intending to cover that DR? If so, there should be tests added to clang/test/CXX/drs/dr21xx.cpp.

The original intent was to fix the bug because I wasn't confident enough that I'll be able to cover all possible cases by the tests. Will the simple examples that I'm already adding to clang/test/Parser/cxx11-type-specifier.cpp test be enough?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153857/new/

https://reviews.llvm.org/D153857



More information about the cfe-commits mailing list