[PATCH] D52400: Improve -Wshadow warnings with enumerators
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 28 09:40:05 PDT 2018
erik.pilkington added inline comments.
================
Comment at: lib/Sema/SemaDecl.cpp:16320
+ // Check for other kinds of shadowing not already handled.
+ CheckShadow(New, PrevDecl, R);
+
----------------
I don't think we should do this for scoped enums in C++, i.e. this should be fine:
```
int Foo;
enum class X { Foo };
```
Can you enclose this in `if (!TheEnumDecl->isScoped())` and add a test? Other than that, LGTM!
https://reviews.llvm.org/D52400
More information about the cfe-commits
mailing list