PR c++/10903
* pt.c (convert_nontype_argument): Fix thinko in diagnostic.
Improve.
From-SVN: r69435
+2003-07-16 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/10903
+ * pt.c (convert_nontype_argument): Fix thinko in diagnostic.
+ Improve.
+
2003-07-15 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (LOOKUP_EXPR): Remove.
}
else
{
- error ("object `%E' cannot be used as template argument", expr);
+ if (TYPE_P (expr))
+ error ("type '%T' cannot be used as a value for a non-type "
+ "template-parameter", expr);
+ else if (DECL_P (expr))
+ error ("invalid use of '%D' as a non-type template-argument", expr);
+ else
+ error ("invalid use of '%E' as a non-type template-argument", expr);
+
return NULL_TREE;
}
--- /dev/null
+struct A { static const bool b=false; };
+
+struct B { typedef A X; };
+
+template <bool> struct C {};
+
+template <typename T> struct D
+{
+ C<T::X> c; // { dg-error "invalid use" }
+};
+
+D<B> d; // { dg-error "" }