This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/65840] New: type of result of at least some libstdc++ xmethods is different than real operator
- From: "dje at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Apr 2015 22:39:55 +0000
- Subject: [Bug libstdc++/65840] New: type of result of at least some libstdc++ xmethods is different than real operator
- Auto-submitted: auto-generated
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.