diff mbox

Fix PR c++/70096 (wrong code for pointer-to-member-function copy)

Message ID yddpouabeee.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth March 31, 2016, 8:06 p.m. UTC
Jason Merrill <jason@redhat.com> writes:

> OK.

The testcase FAILs on Solaris with the native ld:

FAIL: g++.dg/template/ptrmem30.C  -std=c++11 (test for excess errors)
FAIL: g++.dg/template/ptrmem30.C  -std=c++14 (test for excess errors)
FAIL: g++.dg/template/ptrmem30.C  -std=c++98 (test for excess errors)

Excess errors:
ld: warning: symbol 'read' has differing types:
        (file /var/tmp//ccXQGwka.o type=OBJT; file /lib/libc.so type=FUNC);
        /var/tmp//ccXQGwka.o definition taken

Fixed as follows.  Tested with the appropriate runtest invocation on
i386-pc-solaris2.12 and x86_64-pc-linux-gnu, installed on mainline.

	Rainer


2016-03-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* g++.dg/template/ptrmem30.C (read): Rename to data_read.
	(Holder::foo): Reflect this.
diff mbox

Patch

# HG changeset patch
# Parent  fb299874d0c97ca07d2d329ba94ff195243f2499
Fix g++.dg/template/ptrmem30.C with Solaris ld

diff --git a/gcc/testsuite/g++.dg/template/ptrmem30.C b/gcc/testsuite/g++.dg/template/ptrmem30.C
--- a/gcc/testsuite/g++.dg/template/ptrmem30.C
+++ b/gcc/testsuite/g++.dg/template/ptrmem30.C
@@ -1,11 +1,11 @@ 
 // PR c++/70096
 // { dg-do run }
 
-int read;
+int data_read;
 
 struct Holder
 {
-  void foo () { read = data; }
+  void foo () { data_read = data; }
   int data;
 };