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
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
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
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
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,
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
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
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.
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:
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
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
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
12 matches
Mail list logo