aboutsummaryrefslogtreecommitdiff
path: root/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
commit651f86fb6b0f1a251c65a9be6d3fa83e67d5988d (patch)
treed94e979afb54860698a85f31129b29b98a4b7861 /test/SemaCXX/warn-shadow.cpp
parent1e52dfc648ce0b25ef57ae29ef1b4337d80011ef (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-shadow.cpp')
-rw-r--r--test/SemaCXX/warn-shadow.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-shadow.cpp b/test/SemaCXX/warn-shadow.cpp
index c2ab25c5c2..3bf9af414d 100644
--- a/test/SemaCXX/warn-shadow.cpp
+++ b/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);
+ }
+ }
+};
+}