OSDN Git Service

* g++.dg/parse/ctor6.C, g++.dg/parse/defarg11.C,
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Jun 2006 22:26:00 +0000 (22:26 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Jun 2006 22:26:00 +0000 (22:26 +0000)
g++.dg/template/friend42.C, g++.dg/template/spec30.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114585 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/ctor6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/defarg11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/friend42.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/spec30.C [new file with mode: 0644]

index 4b23d39..9274cbd 100644 (file)
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/testsuite/g++.dg/parse/ctor6.C b/gcc/testsuite/g++.dg/parse/ctor6.C
new file mode 100644 (file)
index 0000000..0b14ecc
--- /dev/null
@@ -0,0 +1,11 @@
+// { 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);
diff --git a/gcc/testsuite/g++.dg/parse/defarg11.C b/gcc/testsuite/g++.dg/parse/defarg11.C
new file mode 100644 (file)
index 0000000..5628aa0
--- /dev/null
@@ -0,0 +1,9 @@
+// { 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" }
+};
diff --git a/gcc/testsuite/g++.dg/template/friend42.C b/gcc/testsuite/g++.dg/template/friend42.C
new file mode 100644 (file)
index 0000000..73d10df
--- /dev/null
@@ -0,0 +1,8 @@
+// { dg-do compile }
+
+template <class T> void foo (int);
+
+template <class T>
+class Q {
+  friend void foo<T> (int = 3); // { dg-error "default argument" }
+};
diff --git a/gcc/testsuite/g++.dg/template/spec30.C b/gcc/testsuite/g++.dg/template/spec30.C
new file mode 100644 (file)
index 0000000..403b812
--- /dev/null
@@ -0,0 +1,15 @@
+// { 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;
+}