diff options
author | John McCall <rjmccall@apple.com> | 2017-06-11 20:33:00 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2017-06-11 20:33:00 +0000 |
commit | cb731548fa8f78c4deec94dce12c6af59c2b033a (patch) | |
tree | 37b8e6ca3056abf35102e12c5a94b19846ce50f3 /clang/lib | |
parent | dcfc0413ab3dc42d55f4b63662d3440d899cb03a (diff) | |
download | bcm5719-llvm-cb731548fa8f78c4deec94dce12c6af59c2b033a.tar.gz bcm5719-llvm-cb731548fa8f78c4deec94dce12c6af59c2b033a.zip |
Don't crash when forming a destructor name on an incomplete type.
Fixes PR25156.
Patch by Don Hinton!
llvm-svn: 305169
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 00a4b39f142..a9ff21bc41a 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -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()) |