* g++.dg/parse/ctor6.C, g++.dg/parse/defarg11.C,
g++.dg/template/friend42.C, g++.dg/template/spec30.C: New.
Co-Authored-By: Kazu Hirata <kazu@codesourcery.com>
From-SVN: r114585
+2006-06-12 Mark Mitchell <mark@codesourcery.com>
+ Kazu Hirata <kazu@codesourcery.com>
+
+ * g++.dg/parse/ctor6.C, g++.dg/parse/defarg11.C,
+ g++.dg/template/friend42.C, g++.dg/template/spec30.C: New.
+
2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27933
--- /dev/null
+// { dg-do compile }
+
+// There is no ambiguity in finding a right constructor for X b(a).
+
+class X {
+public:
+ X(const X&, int = 3);
+};
+
+extern X a;
+X b(a);
--- /dev/null
+// { dg-do compile }
+// { dg-options "-pedantic" }
+
+class foo {
+public:
+ void operator& (int = 1); // { dg-error "default argument" }
+ void operator++ (int = 2); // { dg-error "default argument" }
+ void operator-- (int = 3); // { dg-error "default argument" }
+};
--- /dev/null
+// { dg-do compile }
+
+template <class T> void foo (int);
+
+template <class T>
+class Q {
+ friend void foo<T> (int = 3); // { dg-error "default argument" }
+};
--- /dev/null
+// { dg-do compile }
+
+template<int N>
+inline int
+foo (int a)
+{
+ return a;
+}
+
+template<>
+inline int
+foo<0> (int a = 123) // { dg-error "default argument" }
+{
+ return a + 1;
+}