OSDN Git Service

f092b70a46bbb23fdc6e78c5359f6c8829ac9514
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / nullptr04.C
1 // { dg-do compile }
2 // { dg-options "-std=c++0x" }
3
4 // Test cast to int
5
6 const int n4 = static_cast<const int>(nullptr); // { dg-error "invalid static_cast " }
7 const short int n5 = reinterpret_cast<short int>(nullptr); // { dg-error "loses precision" }
8 const long int n6 = reinterpret_cast<long int>(nullptr);
9 const long int n7 = (long int)nullptr;