Loading clang/lib/Sema/SemaDecl.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading clang/test/SemaCXX/goto.cpp +12 −2 Original line number Diff line number Diff line // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s // RUN: %clang_cc1 -fsyntax-only -verify -Wall -fblocks %s // PR9463 double *end; Loading Loading @@ -31,7 +31,7 @@ void h2(int end) { end: ::end = 0; } end: end: // expected-warning{{unused label 'end'}} end = 1; } Loading Loading @@ -66,4 +66,14 @@ namespace PR9495 { } } extern "C" { void exit(int); } void f() { { goto exit; } exit: return; } Loading
clang/lib/Sema/SemaDecl.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
clang/test/SemaCXX/goto.cpp +12 −2 Original line number Diff line number Diff line // RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s // RUN: %clang_cc1 -fsyntax-only -verify -Wall -fblocks %s // PR9463 double *end; Loading Loading @@ -31,7 +31,7 @@ void h2(int end) { end: ::end = 0; } end: end: // expected-warning{{unused label 'end'}} end = 1; } Loading Loading @@ -66,4 +66,14 @@ namespace PR9495 { } } extern "C" { void exit(int); } void f() { { goto exit; } exit: return; }