+2004-11-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/17344
+ * pt.c (coerce_template_parms): Only emit error message about
+ invalid template argument when TF_ERROR.
+
2004-11-12 Mark Mitchell <mark@codesourcery.com>
PR c++/18389
gcc_assert (arg);
if (arg == error_mark_node)
- error ("template argument %d is invalid", i + 1);
+ {
+ if (complain & tf_error)
+ error ("template argument %d is invalid", i + 1);
+ }
else
arg = convert_template_argument (TREE_VALUE (parm),
arg, new_args, complain, i,
+2004-11-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/17344
+ * g++.dg/template/defarg5.C: New test.
+
2004-11-13 Eric Botcazou <ebotcazou@libertysurf.fr>
* g++.dg/parse/cast1.C: Run only on ILP32.
--- /dev/null
+// { dg-do compile }
+
+// Origin: Ivan Godard <igodard@pacbell.net>
+// Wolfgang Bangerth <bangerth@dealii.org>
+
+// PR c++/17344: Substitution failure is not an error
+// for default template argument
+
+template <class> struct intTraits;
+
+template<> struct intTraits<int> {
+ static const int i = 0;
+};
+
+template<typename E, E i = intTraits<E>::i> struct A {};
+
+struct S {
+ template <template <typename> class X> S(X<void>);
+};
+
+int bar(S);
+int bar(A<int,0>);
+
+A<int> bed;
+int i = bar(bed);