2 // { dg-options "-std=gnu++0x" }
8 // p 1 constexpr specifier
9 // objects, static const data
10 struct A1 { }; // { dg-message "no user-provided default constructor" }
12 constexpr int i1 = 1024;
13 constexpr A1 a1 = A1();
15 // error: not a definition
16 extern constexpr int i2; // { dg-error "definition" }
18 // error: missing initializer
19 constexpr A1 a2; // { dg-error "uninitialized const" }
21 // error: duplicate cv
22 const constexpr A1 a3 = A1(); // { dg-error "both .const. and .constexpr. cannot" }
24 volatile constexpr A1 a4 = A1(); // { dg-error "both .volatile. and .constexpr. cannot" }
26 // error: on type declaration
27 constexpr struct pixel
31 }; // { dg-error "cannot be used for type declarations" }