2011-11-09 Jason Merrill <jason@redhat.com>
+ * pt.c (invalid_nontype_parm_type_p): Avoid printing "<type error>".
+
* pt.c (convert_nontype_argument): Only integral arguments
get early folding.
return 0;
if (complain & tf_error)
- error ("%q#T is not a valid type for a template constant parameter", type);
+ {
+ if (type == error_mark_node)
+ inform (input_location, "invalid template non-type parameter");
+ else
+ error ("%q#T is not a valid type for a template non-type parameter",
+ type);
+ }
return 1;
}
+2011-11-09 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/variadic74.C: Adjust diags.
+ * g++.dg/template/crash53.C: Likewise.
+ * g++.dg/template/void9.C: Likewise.
+
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51045
-// { dg-options "-std=gnu++0x" }
+// { dg-do compile { target c++11 } }
template <class... Types> class A
{
public:
- template <Types... Values> class X { /* ... */ }; // { dg-error "not a valid type for a template constant parameter" }
+ template <Types... Values> class X { /* ... */ }; // { dg-error "not a valid type for a template non-type parameter" }
};
template<class... Types> class B
template<typename T> struct B
{
- template<T I> B(A<I>); // { dg-error "template constant parameter" }
+ template<T I> B(A<I>); // { dg-error "template non-type parameter" }
};
B<double> a=A<0>(); // { dg-error "non-scalar type" }
//PR c++/28738
template<int,void> struct A {}; // { dg-error "not a valid type" }
-template<int N> struct A<N,0> {}; // { dg-error "not a valid type" }
+template<int N> struct A<N,0> {}; // { dg-message "invalid" }