summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/defarg6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/defarg6.C')
-rwxr-xr-xgcc/testsuite/g++.old-deja/g++.pt/defarg6.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/defarg6.C b/gcc/testsuite/g++.old-deja/g++.pt/defarg6.C
new file mode 100755
index 0000000..0094c5c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/defarg6.C
@@ -0,0 +1,27 @@
+// Build don't link:
+
+template <class T>
+struct C {
+ template <class U>
+ void f(U); // OK
+
+ template <class V = int>
+ struct I {}; // OK
+
+ template <class W = int>
+ void h(W); // ERROR - default argument
+
+ template <class Y>
+ void k(Y);
+};
+
+template <class T>
+template <class U = double>
+void C<T>::f(U) {} // ERROR - default argument
+
+template <class X = void*>
+void g(X); // ERROR - default argument
+
+template <class T = double>
+template <class Y>
+void C<T>::k(Y) {} // ERROR - default argument