================
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, 
bool AddToContext) {
       cast<FunctionDecl>(D)->isFunctionTemplateSpecialization())
     return;
 
+  if (isa<UsingEnumDecl>(D) && D->getDeclName().isEmpty()) {
----------------
zygoloid wrote:

The reserved identifier check appears to be incorrect. For example, for:
```c++
enum __A {
    x, y
};
void f() {
    using enum __A;
    enum __A e;
}
```
Clang produces two warnings: one on the declaration of `enum __A` and one on 
the `using enum __A`. The second warning is a bug -- the 
`-Wreserved-identifier` warning is only supposed to fire on the declaration of 
a reserved name, and `using enum __A` does not declare the name `__A`, it only 
references it. (Note that there's no warning on the use of `enum __A` on the 
next line, which again is only a reference, not a declaration.)

https://github.com/llvm/llvm-project/pull/87144
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to