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 c++/51379] New: reinterpret_cast is not particularly useful


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

             Bug #: 51379
           Summary: reinterpret_cast is not particularly useful
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: piotr.wyderski@gmail.com


The following code:

int main() {

    unsigned long t1 = 0;
    unsigned long t2 = 1;
    t1 = reinterpret_cast<unsigned long>(t2);
    return 0;
}

compiled using GCC 4.6.2 on Linux/x64:

g++ test.cpp

fails displaying:

test.cpp:5:44: error: invalid cast from type 'long unsigned int' to type 'long
unsigned int'

IMHO this is a rather urgent issue.


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