diff options
| author | Manuel Klimek <klimek@google.com> | 2015-06-26 02:15:04 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2015-06-26 02:15:04 +0000 |
| commit | 5eb6039f160db9e236bcb83c3bf897c4fe87bd9e (patch) | |
| tree | 83aec155f0a6f04173075d3185c44a73f1fd26a2 /clang/lib | |
| parent | 1c1e0c9e71d09581b93b4e0d13fafd06cb28fe64 (diff) | |
| download | bcm5719-llvm-5eb6039f160db9e236bcb83c3bf897c4fe87bd9e.tar.gz bcm5719-llvm-5eb6039f160db9e236bcb83c3bf897c4fe87bd9e.zip | |
Fix crash-on-invalid bug in template instantiation.
Get rid of code-path that (according to Richard Smith) is not needed but
leads to a crasher bug when assuming a template has been fully
instantiated and thus has a definition.
llvm-svn: 240752
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 82ff7c0ca4f..178a14e9ecc 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -2269,33 +2269,6 @@ bool Sema::InstantiateClassTemplateSpecialization( // Perform the actual instantiation on the canonical declaration. ClassTemplateSpec = cast<ClassTemplateSpecializationDecl>( ClassTemplateSpec->getCanonicalDecl()); - - // Check whether we have already instantiated or specialized this class - // template specialization. - if (ClassTemplateSpec->getSpecializationKind() != TSK_Undeclared) { - if (ClassTemplateSpec->getSpecializationKind() == - TSK_ExplicitInstantiationDeclaration && - TSK == TSK_ExplicitInstantiationDefinition) { - // An explicit instantiation definition follows an explicit instantiation - // declaration (C++0x [temp.explicit]p10); go ahead and perform the - // explicit instantiation. - ClassTemplateSpec->setSpecializationKind(TSK); - - // If this is an explicit instantiation definition, mark the - // vtable as used. - if (TSK == TSK_ExplicitInstantiationDefinition && - !ClassTemplateSpec->isInvalidDecl()) - MarkVTableUsed(PointOfInstantiation, ClassTemplateSpec, true); - - return false; - } - - // We can only instantiate something that hasn't already been - // instantiated or specialized. Fail without any diagnostics: our - // caller will provide an error message. - return true; - } - if (ClassTemplateSpec->isInvalidDecl()) return true; |

