diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C new file mode 100644 index 000000000..0a3fcb656 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C @@ -0,0 +1,10 @@ +// PR c++/46930 +// { dg-options -std=c++0x } + +struct S { + static constexpr int size; // { dg-error "must have an initializer" } + // { dg-error "previous declaration" "" { target *-*-* } 5 } +}; + +const int limit = 2 * S::size; +constexpr int S::size = 256; // { dg-error "" } |