OSDN Git Service

2001-02-26 Jeffrey Oldham <oldham@codesourcery.com>
authoroldham <oldham@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Feb 2001 15:54:33 +0000 (15:54 +0000)
committeroldham <oldham@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Feb 2001 15:54:33 +0000 (15:54 +0000)
* g++.old-deja/g++.pt/overload15.C: New test to stress overloaded
templatized constructors.

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

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.pt/overload15.C [new file with mode: 0644]

index 0485463..b16a3f6 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-26  Jeffrey Oldham  <oldham@codesourcery.com>
+
+       * g++.old-deja/g++.pt/overload15.C: New test to stress overloaded
+       templatized constructors.
+
 2001-02-24  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * gcc.c-torture/execute/20010224-1.c: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload15.C b/gcc/testsuite/g++.old-deja/g++.pt/overload15.C
new file mode 100644 (file)
index 0000000..defadad
--- /dev/null
@@ -0,0 +1,25 @@
+// Build don't link:
+// Test resolution of templatized overloaded constructors.
+// The more specialized constructor, i.e., A (const B<Dim1,Dim2> &b)
+// should be chosen per \S 14.5.5.2/2 [temp.func.order/2].
+
+template <int Dim1, int Dim2>
+struct B {
+  int f;
+};
+
+struct A {
+  template <int Dim1, int Dim2>
+  A (const B<Dim1,Dim2> &b) {}
+
+  template <typename T>
+  A (const T &b) {}
+};
+
+int
+main ()
+{
+  B<2,3> b;
+  A a (b);
+  return 0;
+}