This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug regression/48570] gcc-4.6: wrong subscription with -std=c++0x
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Apr 2011 12:22:01 +0000
- Subject: [Bug regression/48570] gcc-4.6: wrong subscription with -std=c++0x
- Auto-submitted: auto-generated
- References: <bug-48570-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48570
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-12 12:21:48 UTC ---
Breakpoint 1, main () at sub.cc:4
4 const wchar_t& z0 = (L"01234")[0];
(gdb) n
5 const wchar_t& z1 = (L"01234")[1];
(gdb)
6 const wchar_t& z2 = (L"01234")[2];
(gdb)
7 const wchar_t& z3 = (L"01234")[3];
(gdb)
8 return (z1 == L'1');
(gdb) p z0
$1 = (const wchar_t &) @0x7fffffffe590: 48 L'0'
(gdb) p z1
$2 = (const wchar_t &) @0x7fffffffe594: 0 L'\000'
(gdb) p z2
$3 = (const wchar_t &) @0x7fffffffe598: 0 L'\000'
(gdb) p z3
$4 = (const wchar_t &) @0x7fffffffe59c: 0 L'\000'
The string literal contains zeroes past the first character