// { dg-do compile } // { dg-options "-std=c++0x" } // Test cast to int __extension__ typedef __INTPTR_TYPE__ intptr_t; const int n4 = static_cast(nullptr); // { dg-error "invalid static_cast " } const short int n5 = reinterpret_cast(nullptr); // { dg-error "loses precision" } const intptr_t n6 = reinterpret_cast(nullptr); const intptr_t n7 = (intptr_t)nullptr; decltype(nullptr) mynull = 0; const int n8 = static_cast(mynull); // { dg-error "invalid static_cast " } const short int n9 = reinterpret_cast(mynull); // { dg-error "loses precision" } const intptr_t n10 = reinterpret_cast(mynull); const intptr_t n11 = (intptr_t)mynull;