[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-10-23 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg added a comment. > I've silenced this scenario in r344898, thank you for raising the issue! thanks! works fine for me https://reviews.llvm.org/D52400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailma

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-10-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D52400#1267731, @aaron.ballman wrote: > In https://reviews.llvm.org/D52400#1267499, @sberg wrote: > > > (and in any case, "declaration shadows a variable" sounds wrong when the > > shadowed entity is a class type. thats why I thought som

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-10-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D52400#1267499, @sberg wrote: > In https://reviews.llvm.org/D52400#1266341, @aaron.ballman wrote: > > > In https://reviews.llvm.org/D52400#1266307, @sberg wrote: > > > > > > > > > > [...] > > > Then again, this is a case where you don't g

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-10-17 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg added a comment. In https://reviews.llvm.org/D52400#1266341, @aaron.ballman wrote: > In https://reviews.llvm.org/D52400#1266307, @sberg wrote: > > > > [...] > Then again, this is a case where you don't get any error but you do get a > silent behavioral ambiguity without the current enum

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-10-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D52400#1266307, @sberg wrote: > doesnt this make -Wshadow more aggressive for enumerators than for other > entities? It does, but whether that's an issue with the enumerator shadow diagnosing or with the other entities not diagnosing,

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-10-16 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg added a comment. doesnt this make -Wshadow more aggressive for enumerators than for other entities? ~ cat test17.cc struct S1; struct S2; struct S3 { void S1(); enum { S2 }; }; ~ llvm/inst/bin/clang++ -fsyntax-only -Wshadow test17.cc test17.cc:5:10: warning: decla

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-10-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Committed in r344259 on @erik.pilkington 's LGTM. Self-accepting so I can close the review. https://reviews.llvm.org/D52400 ___ cf

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-09-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/Sema/SemaDecl.cpp:16320 +// Check for other kinds of shadowing not already handled. +CheckShadow(New, PrevDecl, R); + erik.pilkington wrote: > I don't think we should do this for scoped enums in C++, i.

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-09-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 167507. aaron.ballman marked an inline comment as done. aaron.ballman added a comment. Updating based on review feedback. https://reviews.llvm.org/D52400 Files: lib/Sema/SemaDecl.cpp test/Sema/warn-shadow.c test/SemaCXX/warn-shadow.cpp Index:

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-09-28 Thread Erik Pilkington via Phabricator via cfe-commits
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

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-09-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: echristo. aaron.ballman added a comment. Ping? https://reviews.llvm.org/D52400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52400: Improve -Wshadow warnings with enumerators

2018-09-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: rsmith, dblaikie. Currently, we do not check for enumerators that shadow other enumerators as part of -Wshadow, but gcc does provide such a diagnostic for this case. This is intended to catch shadowing issues like: enum E1{e