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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-object1.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
// From N2235
5
 
6
// 4.5.2 semantics
7
 
8
// p 1 constexpr specifier
9
// objects, static const data
10
struct A1 { int i; };      // { dg-message "no user-provided default constructor" }
11
 
12
constexpr int i1 = 1024;
13
constexpr A1 a1 = A1();
14
 
15
// error: not a definition
16
extern constexpr int i2; // { dg-error "definition" }
17
 
18
// error: missing initializer
19
constexpr A1 a2; // { dg-error "uninitialized const" }
20
 
21
// error: duplicate cv
22
const constexpr A1 a3 = A1(); // { dg-error "both .const. and .constexpr. cannot" }
23
 
24
volatile constexpr A1 a4 = A1(); // { dg-error "both .volatile. and .constexpr. cannot" }
25
 
26
// error: on type declaration
27
constexpr struct pixel
28
{
29
  int x;
30
  int y;
31
};                   // { dg-error "cannot be used for type declarations" }

powered by: WebSVN 2.1.0

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