From 2851a0e4674532d87356e9e4a28f453511110796 Mon Sep 17 00:00:00 2001 From: Jeffrey Oldham Date: Mon, 26 Feb 2001 15:54:33 +0000 Subject: [PATCH] overload15.C: New test to stress overloaded templatized constructors. 2001-02-26 Jeffrey Oldham * g++.old-deja/g++.pt/overload15.C: New test to stress overloaded templatized constructors. From-SVN: r40067 --- gcc/testsuite/ChangeLog | 5 ++++ .../g++.old-deja/g++.pt/overload15.C | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/overload15.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0485463917a9..b16a3f6d8752 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2001-02-26 Jeffrey Oldham + + * g++.old-deja/g++.pt/overload15.C: New test to stress overloaded + templatized constructors. + 2001-02-24 Franz Sirl * 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 index 000000000000..defadadb1119 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/overload15.C @@ -0,0 +1,25 @@ +// Build don't link: +// Test resolution of templatized overloaded constructors. +// The more specialized constructor, i.e., A (const B &b) +// should be chosen per \S 14.5.5.2/2 [temp.func.order/2]. + +template +struct B { + int f; +}; + +struct A { + template + A (const B &b) {} + + template + A (const T &b) {} +}; + +int +main () +{ + B<2,3> b; + A a (b); + return 0; +} -- 2.43.5