From cedc390db046c7832e1ff7e576df07bce787fe72 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 25 Mar 2011 05:42:19 +0000 Subject: --- Merging r128210 into '.': U test/SemaCXX/goto.cpp U lib/Sema/SemaDecl.cpp llvm-svn: 128255 --- clang/lib/Sema/SemaDecl.cpp | 2 +- clang/test/SemaCXX/goto.cpp | 14 ++++++++++++-- 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; +} -- cgit v1.1