summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-shadow.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-08 18:21:25 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-08 18:21:25 +0000
commit898fdbf82d622b01365d8724908fe512cd805cf7 (patch)
tree1ccb0f527db7958333cc51c7ac3fa00152ef96e4 /clang/test/SemaCXX/warn-shadow.cpp
parent8665d59f4621ebc2a37da729c2618b163fb96192 (diff)
downloadbcm5719-llvm-898fdbf82d622b01365d8724908fe512cd805cf7.tar.gz
bcm5719-llvm-898fdbf82d622b01365d8724908fe512cd805cf7.zip
In Sema::CheckShadow, get the DeclContext from the variable that we are checking
instead from the Scope; Inner scopes in bodies don't have DeclContexts associated with them. Fixes http://llvm.org/PR9160 & rdar://problem/8966163. llvm-svn: 125097
Diffstat (limited to 'clang/test/SemaCXX/warn-shadow.cpp')
-rw-r--r--clang/test/SemaCXX/warn-shadow.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-shadow.cpp b/clang/test/SemaCXX/warn-shadow.cpp
index c2ab25c5c26..3bf9af414db 100644
--- a/clang/test/SemaCXX/warn-shadow.cpp
+++ b/clang/test/SemaCXX/warn-shadow.cpp
@@ -55,3 +55,18 @@ void Foo::Baz() {
double Bar = 12; // Don't warn.
}
}
+
+// http://llvm.org/PR9160
+namespace PR9160 {
+struct V {
+ V(int);
+};
+struct S {
+ V v;
+ static void m() {
+ if (1) {
+ V v(0);
+ }
+ }
+};
+}
OpenPOWER on IntegriCloud