* pt.c (check_explicit_specialization): If the declarator is a
template-id, only check whether the arguments are dependent.
From-SVN: r268997
2019-02-18 Jason Merrill <jason@redhat.com>
+ * pt.c (check_explicit_specialization): If the declarator is a
+ template-id, only check whether the arguments are dependent.
+
Improve duplicate [[likely]] diagnostic.
* parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
to process_stmt_hotness_attribute.
/* This case handles bogus declarations like template <>
template <class T> void f<int>(); */
- if (!uses_template_parms (declarator))
+ if (!uses_template_parms (TREE_OPERAND (declarator, 1)))
error ("template-id %qD in declaration of primary template",
declarator);
else if (variable_template_p (TREE_OPERAND (declarator, 0)))
#include <stdio.h>
template <int n1>
-double val <int> () // { dg-error "" } bogus code
+double val <int> () // { dg-error "expected" "" { target c++17_down } } bogus code
+// { dg-error "template-id .val<int>. in declaration of primary template" "" { target c++2a } .-1 }
{
return (double) n1;
}