OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [nullptr04.C] - Blame information for rev 707

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-std=c++0x" }
3
 
4
// Test cast to int
5
 
6
__extension__ typedef __INTPTR_TYPE__ intptr_t;
7
 
8
const int n4 = static_cast(nullptr); // { dg-error "invalid static_cast " }
9
const short int n5 = reinterpret_cast(nullptr); // { dg-error "loses precision" }
10
const intptr_t n6 = reinterpret_cast(nullptr);
11
const intptr_t n7 = (intptr_t)nullptr;
12
 
13
decltype(nullptr) mynull = 0;
14
const int n8 = static_cast(mynull); // { dg-error "invalid static_cast " }
15
const short int n9 = reinterpret_cast(mynull); // { dg-error "loses precision" }
16
const intptr_t n10 = reinterpret_cast(mynull);
17
const intptr_t n11 = (intptr_t)mynull;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.