summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2015-10-01 22:38:51 +0000
committerKaelyn Takata <rikka@google.com>2015-10-01 22:38:51 +0000
commit2648702e9238e28184e78e1db83795617bac2ba8 (patch)
tree0972c2900bb3cd34bfa99dd7880c725755caa71b /clang/lib/Sema/SemaLookup.cpp
parent8f13bef575c97db4d6c146c3bb647ac9e73a9248 (diff)
downloadbcm5719-llvm-2648702e9238e28184e78e1db83795617bac2ba8.tar.gz
bcm5719-llvm-2648702e9238e28184e78e1db83795617bac2ba8.zip
Don't try to get a CXXRecordDecl from a non-class TemplateSpecializationType.
With -fms-extensions it is possible to have a non-class record that is a template specialization cause an assertion failure via the call to Type::getAsCXXRecordDecl. Fixes PR 24246. llvm-svn: 249090
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index bda535bc654..05a347ecdf3 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -3818,6 +3818,8 @@ void TypoCorrectionConsumer::addNamespaces(
SSIsTemplate = T->getTypeClass() == Type::TemplateSpecialization;
}
for (const auto *TI : SemaRef.getASTContext().types()) {
+ if (!TI->isClassType() && isa<TemplateSpecializationType>(TI))
+ continue;
if (CXXRecordDecl *CD = TI->getAsCXXRecordDecl()) {
CD = CD->getCanonicalDecl();
if (!CD->isDependentType() && !CD->isAnonymousStructOrUnion() &&
OpenPOWER on IntegriCloud