mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-12 01:18:53 +00:00
Don't crash when forming a destructor name on an incomplete type.
Fixes PR25156. Patch by Don Hinton! llvm-svn: 305169
This commit is contained in:
parent
dcfc0413ab
commit
cb731548fa
@ -189,12 +189,15 @@ ParsedType Sema::getDestructorName(SourceLocation TildeLoc,
|
||||
// have one) and, if that fails to find a match, in the scope (if
|
||||
// we're allowed to look there).
|
||||
Found.clear();
|
||||
if (Step == 0 && LookupCtx)
|
||||
if (Step == 0 && LookupCtx) {
|
||||
if (RequireCompleteDeclContext(SS, LookupCtx))
|
||||
return nullptr;
|
||||
LookupQualifiedName(Found, LookupCtx);
|
||||
else if (Step == 1 && LookInScope && S)
|
||||
} else if (Step == 1 && LookInScope && S) {
|
||||
LookupName(Found, S);
|
||||
else
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
// FIXME: Should we be suppressing ambiguities here?
|
||||
if (Found.isAmbiguous())
|
||||
|
@ -169,6 +169,13 @@ void N::f() { } // okay
|
||||
struct Y; // expected-note{{forward declaration of 'Y'}}
|
||||
Y::foo y; // expected-error{{incomplete type 'Y' named in nested name specifier}}
|
||||
|
||||
namespace PR25156 {
|
||||
struct Y; // expected-note{{forward declaration of 'PR25156::Y'}}
|
||||
void foo() {
|
||||
Y::~Y(); // expected-error{{incomplete type 'PR25156::Y' named in nested name specifier}}
|
||||
}
|
||||
}
|
||||
|
||||
X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}}
|
||||
|
||||
struct foo_S {
|
||||
|
Loading…
Reference in New Issue
Block a user