From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112264 invoked by alias); 21 Apr 2015 22:40:01 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 111922 invoked by uid 48); 21 Apr 2015 22:39:56 -0000 From: "dje at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/65840] New: type of result of at least some libstdc++ xmethods is different than real operator Date: Tue, 21 Apr 2015 22:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: dje at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01765.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65840 Bug ID: 65840 Summary: type of result of at least some libstdc++ xmethods is different than real operator Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: dje at google dot com Using libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc as a testcase, and modifying it to ensure the * operator is compiled in: --- gcc-unique_ptr.cc.~1~ 2015-04-21 15:17:37.863001716 -0700 +++ gcc-unique_ptr.cc 2015-04-21 15:18:14.666458223 -0700 @@ -30,7 +30,7 @@ main () // { dg-final { note-test *p 10 } } // { dg-final { regexp-test p.get() 0x.* } } - return 0; // Mark SPOT + return *p; // Mark SPOT } // { dg-final { gdb-test SPOT {} 1 } } bash$ gdb a.out (gdb) start (gdb) n # keep next'ing until we get here: 33 return *p; // Mark SPOT (gdb) p *p $1 = 10 (gdb) disable xm (gdb) p *p $2 = (int &) @0x403010: 10 (gdb) pt $1 type = int (gdb) pt $2 type = int & Note the difference in type of the result of the xmethod vs the real * operator. IWBN if they had the same type. If this requires additions to gdb we can do that.