public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57155] New: casting to const reference error
@ 2013-05-03  7:34 rockeet at gmail dot com
  2013-05-03  9:04 ` [Bug c++/57155] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rockeet at gmail dot com @ 2013-05-03  7:34 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57155

             Bug #: 57155
           Summary: casting to const reference error
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rockeet@gmail.com


#include <assert.h>
int main() {
    const char* buf = "12345678";
    const int& cref = (const int&)buf[0];
    const int&  ref = (      int&)buf[0];
    assert(cref == ref);
    return 0;
}

// Above assertion failed on g++4.1.2, g++4.4.6, g++4.7.1 and g++4.7.2
// These are all my tested g++ version
// cref just got first byte of buf


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-03 10:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03  7:34 [Bug c++/57155] New: casting to const reference error rockeet at gmail dot com
2013-05-03  9:04 ` [Bug c++/57155] " redi at gcc dot gnu.org
2013-05-03  9:08 ` redi at gcc dot gnu.org
2013-05-03 10:35 ` rockeet at gmail dot com
2013-05-03 10:51 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).