diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-20 20:45:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-20 20:45:25 +0000 |
commit | 419bb33b0b23a925270296e8a58ca3c0b38baa69 (patch) | |
tree | 1e642ac7354208d2c7b2c13e0d5af4a11c342f69 | |
parent | 03fc3f765771f915e30145fdc5735de5c1566fe3 (diff) | |
download | bcm5719-llvm-419bb33b0b23a925270296e8a58ca3c0b38baa69.tar.gz bcm5719-llvm-419bb33b0b23a925270296e8a58ca3c0b38baa69.zip |
PR24483: Delete some dead/incorrect code that triggered assertions.
llvm-svn: 245609
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 19 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-var-template.cpp | 6 |
2 files changed, 6 insertions, 19 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 2c33c5e17cf..85e8e318959 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -2469,25 +2469,6 @@ DeclResult Sema::ActOnVarTemplateSpecialization( false, Converted)) return true; - // Check that the type of this variable template specialization - // matches the expected type. - TypeSourceInfo *ExpectedDI; - { - // Do substitution on the type of the declaration - TemplateArgumentList TemplateArgList(TemplateArgumentList::OnStack, - Converted.data(), Converted.size()); - InstantiatingTemplate Inst(*this, TemplateKWLoc, VarTemplate); - if (Inst.isInvalid()) - return true; - VarDecl *Templated = VarTemplate->getTemplatedDecl(); - ExpectedDI = - SubstType(Templated->getTypeSourceInfo(), - MultiLevelTemplateArgumentList(TemplateArgList), - Templated->getTypeSpecStartLoc(), Templated->getDeclName()); - } - if (!ExpectedDI) - return true; - // Find the variable template (partial) specialization declaration that // corresponds to these arguments. if (IsPartialSpecialization) { diff --git a/clang/test/SemaTemplate/instantiate-var-template.cpp b/clang/test/SemaTemplate/instantiate-var-template.cpp index bd7c43334f7..b7b83e4afdd 100644 --- a/clang/test/SemaTemplate/instantiate-var-template.cpp +++ b/clang/test/SemaTemplate/instantiate-var-template.cpp @@ -34,3 +34,9 @@ namespace InstantiationDependent { static_assert(a<sizeof(sizeof(f(T())))> == 0, ""); // expected-error {{static_assert failed}} } } + +namespace PR24483 { + template<typename> struct A; + template<typename... T> A<T...> models; + template<> struct B models<>; // expected-error {{incomplete type 'struct B'}} expected-note {{forward declaration}} +} |