diff options
-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}} +} |