[PATCH] D60956: [Sema] Fix the lookup for a declaration conflicting with an enumerator

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 17:17:48 PDT 2019


riccibruno marked 3 inline comments as done.
riccibruno added inline comments.


================
Comment at: test/CXX/dcl.dcl/dcl.enum/p11-enumerator_scope.cpp:107
   enum { typedef_type };                // expected-error {{redefinition of 'typedef_type'}}
 };
 
----------------
riccibruno wrote:
> Note also that this is just my interpretation, and I am not entirely confident that this is correct.
> 
>  As a data point GCC rejects `enum { t }` in the template and accepts the other two enumerators, and then in the instantiation rejects `enum { t }` and `enum { typedef_type }` but accepts `enum { type }` (presumably because it delays the check for the hiding rules to the instantiation).
I have checked and I believe that this is exactly what CWG 11 says.


Repository:
  rC Clang

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

https://reviews.llvm.org/D60956





More information about the cfe-commits mailing list