aboutsummaryrefslogtreecommitdiff
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
commitcedc390db046c7832e1ff7e576df07bce787fe72 (patch)
tree40bcf01a72e98b84b146a8ef08800131e535d88c
parentdce4b0ea682cc795e1fc21fb7a6ec042212da72d (diff)
downloadllvm-cedc390db046c7832e1ff7e576df07bce787fe72.zip
llvm-cedc390db046c7832e1ff7e576df07bce787fe72.tar.gz
llvm-cedc390db046c7832e1ff7e576df07bce787fe72.tar.bz2
--- Merging r128210 into '.':
U test/SemaCXX/goto.cpp U lib/Sema/SemaDecl.cpp llvm-svn: 128255
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
-rw-r--r--clang/test/SemaCXX/goto.cpp14
2 files changed, 13 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 065149b..b1ed22e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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/clang/test/SemaCXX/goto.cpp b/clang/test/SemaCXX/goto.cpp
index 8b83796..d7057bb 100644
--- a/clang/test/SemaCXX/goto.cpp
+++ b/clang/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;
+}