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

Subversion Repositories openrisc

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

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=gnu++0x" }
3
 
4
constexpr int verysquare(int x) { return x * x; }
5
 
6
const double mass = 9.8;
7
constexpr double energy = mass * verysquare(56.6); // { dg-error "mass" "" { xfail *-*-* } }
8
 
9
int arr[(int)mass];             // { dg-error "mass" "" { xfail *-*-* } }
10
 
11
float array[verysquare(9)];         // OK -- not C99 VLA
12
 
13
extern const int medium;
14
const int high = verysquare(medium); // OK -- dynamic initialization
15
 
16
enum { Max = verysquare(7) };      // OK

powered by: WebSVN 2.1.0

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