summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/overload12.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload12.C b/gcc/testsuite/g++.old-deja/g++.pt/overload12.C
new file mode 100644
index 00000000000..bf37bb66867
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/overload12.C
@@ -0,0 +1,21 @@
+// Testcase for not trying a candidate that would generate an ill-formed
+// instantiation.
+
+template <int N> struct A {
+ int ar[N];
+};
+
+template <int N> struct B {
+ B () { };
+ B (const A<N> &) { };
+ B (const A<N-1> &, int);
+};
+
+int
+main ()
+{
+ A<1> a;
+ B<1> b1;
+ B<1> b2 (a);
+}
+