This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch]: Testcase for bug in overload resolution.
- To: robertl at dgii dot com
- Subject: [patch]: Testcase for bug in overload resolution.
- From: Klaus-Georg Adams <Klaus-Georg dot Adams at chemie dot uni-karlsruhe dot de>
- Date: Thu, 18 Jun 1998 10:30:50 +0200
- Cc: egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com
Attached is a new failing testcase for egcs.
kga
--
-------------------------------------------------------------------------
Klaus-Georg Adams Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------
--- /dev/null Mon Jul 18 01:46:18 1994
+++ gcc/testsuite/g++.old-deja/g++.robertl/eb131.C Thu Jun 18 10:27:12 1998
@@ -0,0 +1,28 @@
+// Build don't link
+// The call to a::foo() generates an error:
+// eb131.C: In method `a::a()':
+// eb131.C:26: no matching function for call to `a::foo (void (a::*)(double))'
+// eb131.C:15: candidates are: a::foo(void (a::*)(float))
+// According to [over.over] in the CD2, &junk should resolve in this context.
+
+struct a {
+ a();
+ void junk();
+ void junk( int );
+ void junk( float );
+ void junk( double );
+
+ void foo( void (a::*member)(float) );
+ void bar( void (*function)(float) );
+};
+
+void baz();
+void baz( int );
+void baz( float );
+void baz( double );
+
+a::a()
+{
+ foo( &junk );
+ bar( &baz );
+}