================
@@ -8341,6 +8341,11 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl 
*ShadowedDecl,
     // shadowing context, but that's just a false negative.
   }
 
+  // Skip shadowing check if we're in a class scope, dealing with an enum
+  // constant in a different context.
+  if (S->isClassScope() && isa<EnumConstantDecl>(D) &&
----------------
a-tarasyuk wrote:

I think in this case `NewDC` refers to `EnumDeclaration`, so maybe checking 
`RedeclContext` would work, though it needs verification. Is relying on `Scope` 
not permitted here?



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

Reply via email to