re PR c++/10126 (ICE in convert_nontype_argument on using overload resolution in...
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Tue, 2 Dec 2003 15:50:44 +0000 (15:50 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Tue, 2 Dec 2003 15:50:44 +0000 (15:50 +0000)
PR c++/10126
* g++.dg/template/ptrmem8.C: New test.

From-SVN: r74185

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/ptrmem8.C [new file with mode: 0644]

index 3164e9289c6c9c04496653e37a4f8dfab73ba814..0901e565c01889187a3ec0ffbedc8c28f2f49478 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-02  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/10126\r
+       * g++.dg/template/ptrmem8.C: New test.
+
 2003-12-02  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/12573\r
diff --git a/gcc/testsuite/g++.dg/template/ptrmem8.C b/gcc/testsuite/g++.dg/template/ptrmem8.C
new file mode 100644 (file)
index 0000000..c0a1fa3
--- /dev/null
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// Origin: <marco dot franzen at bigfoot dot com> 
+// PR c++/10126: Handle ptmf default conversions while matching a template 
+//  argument
+
+struct B 
+{
+  int I () const;
+  int I ();
+};
+
+struct D : B {};
+
+template <int (D::*fun)() const> int Get();
+
+int main () 
+{
+  Get<&B::I>();   // { dg-error "no matching function" }
+  Get<&D::I>();   // { dg-error "no matching function" }
+}