+2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28363
+ * semantics.c (check_template_template_default_arg): Simplify
+ error handling.
+
2006-07-20 Steve Ellcey <sje@cup.hp.com>
PR c++/27495
&& TREE_CODE (argument) != UNBOUND_CLASS_TEMPLATE)
{
if (TREE_CODE (argument) == TYPE_DECL)
- {
- tree t = TREE_TYPE (argument);
-
- /* Try to emit a slightly smarter error message if we detect
- that the user is using a template instantiation. */
- if (CLASSTYPE_TEMPLATE_INFO (t)
- && CLASSTYPE_TEMPLATE_INSTANTIATION (t))
- error ("invalid use of type %qT as a default value for a "
- "template template-parameter", t);
- else
- error ("invalid use of %qD as a default value for a template "
- "template-parameter", argument);
- }
+ error ("invalid use of type %qT as a default value for a template "
+ "template-parameter", TREE_TYPE (argument));
else
error ("invalid default argument for a template template parameter");
return error_mark_node;
--- /dev/null
+// PR c++/28363
+// { dg-do compile }
+
+template<typename T, template<int> class = T> // { dg-error "invalid use of type" }
+struct A;
+
+typedef int I;
+template<template<int> class = I> // { dg-error "invalid use of type" }
+struct B;
+
+struct S;
+template<template<int> class = S> // { dg-error "invalid use of type" }
+struct C;