summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-03-25 05:42:19 +0000
committerBill Wendling <isanbard@gmail.com>2011-03-25 05:42:19 +0000
commit0d45b38388836a1fed4fb2e6fd2866f1a4d2fc60 (patch)
tree641b4afc565ab203e4ba58e14cfca2b6343c8834
parent63f8393944b3ff8111c91fb0558ca18f6e02e725 (diff)
--- Merging r128210 into '.':
U test/SemaCXX/goto.cpp U lib/Sema/SemaDecl.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_29@128255 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDecl.cpp2
-rw-r--r--test/SemaCXX/goto.cpp14
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 065149b1ea..b1ed22e993 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -499,7 +499,7 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext) {
// isn't strictly lexical, which breaks name lookup. Be careful to insert
// the label at the appropriate place in the identifier chain.
for (I = IdResolver.begin(D->getDeclName()); I != IEnd; ++I) {
- DeclContext *IDC = (*I)->getLexicalDeclContext();
+ DeclContext *IDC = (*I)->getLexicalDeclContext()->getRedeclContext();
if (IDC == CurContext) {
if (!S->isDeclScope(*I))
continue;
diff --git a/test/SemaCXX/goto.cpp b/test/SemaCXX/goto.cpp
index 8b8379613d..d7057bb87f 100644
--- a/test/SemaCXX/goto.cpp
+++ b/test/SemaCXX/goto.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -fblocks %s
// PR9463
double *end;
@@ -31,7 +31,7 @@ void h2(int end) {
end:
::end = 0;
}
- end:
+ end: // expected-warning{{unused label 'end'}}
end = 1;
}
@@ -66,4 +66,14 @@ namespace PR9495 {
}
}
+extern "C" {
+ void exit(int);
+}
+void f() {
+ {
+ goto exit;
+ }
+ exit:
+ return;
+}