forked from OSchip/llvm-project
Minor fix in the injection of labels, since we want to look at the redeclaration context of each declaration in the identifier chain. Should fix Linux self-host
llvm-svn: 128210
This commit is contained in:
parent
084e83dfe7
commit
d7d7e0d3df
|
@ -500,7 +500,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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -Wall -fblocks %s
|
||||
|
||||
// PR9463
|
||||
double *end;
|
||||
|
@ -57,7 +57,7 @@ void h2(int end) {
|
|||
end:
|
||||
::end = 0;
|
||||
}
|
||||
end:
|
||||
end: // expected-warning{{unused label 'end'}}
|
||||
end = 1;
|
||||
}
|
||||
|
||||
|
@ -92,4 +92,14 @@ namespace PR9495 {
|
|||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
void exit(int);
|
||||
}
|
||||
|
||||
void f() {
|
||||
{
|
||||
goto exit;
|
||||
}
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue