This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug regression/48570] gcc-4.6: wrong subscription with -std=c++0x


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]