location in the diagnostic.
(convert_template_argument): Just return if parm is error_mark_node.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219067
138bc75d-0d04-0410-961f-
82ee72b054a4
2014-12-25 Jason Merrill <jason@redhat.com>
+ * pt.c (check_default_tmpl_args): Uses the parameter source
+ location in the diagnostic.
+ (convert_template_argument): Just return if parm is error_mark_node.
+
PR c++/63522
* parser.c (cp_parser_type_parameter): Call
check_for_bare_parameter_packs on default argument.
parameter pack, at the end of the template
parameter list. */
- if (TREE_CODE (TREE_VALUE (parm)) == PARM_DECL)
- error ("parameter pack %qE must be at the end of the"
- " template parameter list", TREE_VALUE (parm));
- else
- error ("parameter pack %qT must be at the end of the"
- " template parameter list",
- TREE_TYPE (TREE_VALUE (parm)));
+ error ("parameter pack %q+D must be at the end of the"
+ " template parameter list", TREE_VALUE (parm));
TREE_VALUE (TREE_VEC_ELT (inner_parms, i))
= error_mark_node;
tree val;
int is_type, requires_type, is_tmpl_type, requires_tmpl_type;
+ if (parm == error_mark_node)
+ return error_mark_node;
+
if (TREE_CODE (arg) == TREE_LIST
&& TREE_CODE (TREE_VALUE (arg)) == OFFSET_REF)
{
static int i;
};
-A<int, int> a; // { dg-error "mismatch|expected|invalid type" }
-A<char,int> b; // { dg-error "mismatch|expected|invalid type" }
+A<int, int> a;
+A<char,int> b;
template <template <typename...> class C> B(C<int>);
};
-B b = A<int>(); // { dg-error "mismatch|expected" }
+B b = A<int>();
// { dg-do compile { target c++11 } }
template<typename ...T, int = 0> struct A {}; // { dg-error "end of" }
-A<int> a; // { dg-error "mismatch|expected|invalid" }
+A<int> a;
// { dg-do compile { target c++11 } }
-template<typename... Values, typename T>
-struct backward_tuple {}; // { dg-error "end" }
+template<typename... Values, typename T> // { dg-error "end" }
+struct backward_tuple {};
template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" }
struct A {};
-template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" }
+template<int> void foo(A<int>); // { dg-error "cast|argument" "" { target c++98_only } }
template<int(> struct C; // { dg-error "token" }
};
-A<char> a; // { dg-error "type/value mismatch|constant|declaration" }
+A<char> a;