From: David Majnemer Date: Mon, 11 Jul 2016 17:09:56 +0000 (+0000) Subject: [Sema] Don't artificially forbid BuiltinTemplateDecls in CheckTemplateArgument X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57615ee15f3ba578f47684e6696ff67f6428d185;p=clang [Sema] Don't artificially forbid BuiltinTemplateDecls in CheckTemplateArgument After thinking about it, we don't really need to forbid BuiltinTemplateDecls explicitly. The restriction doesn't really buy us anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275078 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index c1b6b5e45a..8175df37ba 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -5377,14 +5377,13 @@ bool Sema::CheckTemplateArgument(TemplateTemplateParmDecl *Param, // partial specializations. if (!isa(Template) && !isa(Template) && - !isa(Template)) { - assert((isa(Template) || - isa(Template)) && - "Only function or builtin templates are possible here"); + !isa(Template) && + !isa(Template)) { + assert(isa(Template) && + "Only function templates are possible here"); Diag(Arg.getLocation(), diag::err_template_arg_not_valid_template); - if (isa(Template)) - Diag(Template->getLocation(), diag::note_template_arg_refers_here_func) - << Template; + Diag(Template->getLocation(), diag::note_template_arg_refers_here_func) + << Template; } TemplateParameterList *Params = Param->getTemplateParameters(); diff --git a/test/SemaCXX/make_integer_seq.cpp b/test/SemaCXX/make_integer_seq.cpp index 0cab0cf6e7..a9b8d2b23c 100644 --- a/test/SemaCXX/make_integer_seq.cpp +++ b/test/SemaCXX/make_integer_seq.cpp @@ -48,6 +48,6 @@ using illformed2 = ErrorSeq; template void f() {} __make_integer_seq x; // expected-error{{template template parameter must be a class template or type alias template}} -__make_integer_seq<__make_integer_seq, int, 10> PR28494; // expected-error{{does not refer to a class or alias template, or template template parameter}} expected-error{{different template parameters}} +__make_integer_seq<__make_integer_seq, int, 10> PR28494; // expected-error{{different template parameters}} // expected-note@make_integer_seq.cpp:* {{template parameter has a different kind}} // expected-note@make_integer_seq.cpp:* {{previous template template parameter is here}}