[clang] [Clang] skip shadow warnings for enum constants in distinct class scopes (PR #115656)
Michael Jabbour via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 2 09:27:06 PDT 2025
michael-jabbour-sonarsource wrote:
Hello,
I think that the following cases used to be valid reports on clang 19, but they are not reported in clang 20 after this patch. Is this intended?
```cpp
namespace classEnums {
int globalVar = 0;
class ClassWithEnum {
enum Enum {
globalVar // No -Wshadow after this patch.
};
};
class OuterClass {
static const int memberData = 0;
enum Enum {
enumVal
};
class InnerClass {
enum Enum {
memberData, // No -Wshadow after this patch.
enumVal // No -Wshadow after this patch.
};
};
};
}
```
CE: https://godbolt.org/z/no87EEYxn
@a-tarasyuk, @Fznamznon, @Sirraide
https://github.com/llvm/llvm-project/pull/115656
More information about the cfe-commits
mailing list