[clang][DR2621] using enum NAME lookup fix
authorNathan Sidwell <nathan@acm.org>
Wed, 14 Sep 2022 17:42:34 +0000 (10:42 -0700)
committerNathan Sidwell <nathan@acm.org>
Wed, 28 Sep 2022 15:50:27 +0000 (08:50 -0700)
commit3d2080683f1dc37010fb56cf7d0e1632cda00f15
tree09bc23009069dea0682e1980d21f9ce2c3ad3de1
parent868a8fd88f84b26e810ccf18af8e621947031cbb
[clang][DR2621] using enum NAME lookup fix

Although using-enum's grammar is 'using elaborated-enum-specifier',
the lookup for the enum is ordinary lookup (and not the tagged-type
lookup that normally occurs wth an tagged-type specifier).  Thus (a)
we can find typedefs and (b) do not find enum tags hidden by a non-tag
name (the struct stat thing).

This reimplements that part of using-enum handling, to address DR2621,
where clang's behaviour does not match std intent (and other
compilers).

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D134283
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/CXX/drs/dr26xx.cpp
clang/test/CodeCompletion/using-enum.cpp
clang/test/Parser/cxx20-using-enum.cpp
clang/test/SemaCXX/cxx20-using-enum.cpp