summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/template42.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/template42.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template42.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template42.C b/gcc/testsuite/g++.old-deja/g++.jason/template42.C
new file mode 100644
index 000000000..63122ceb0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/template42.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// Testcase for not evaluating template default args if they are
+// never used.
+
+struct X {
+ X(int) { }
+};
+
+template <class T>
+struct A {
+ void f (T t = T()) { }
+};
+
+int main ()
+{
+ A<X> a;
+ X x (1);
+ a.f (x);
+}