diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C new file mode 100644 index 0000000..388a734 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C @@ -0,0 +1,9 @@ +// { dg-do compile { target c++11 } } +// Core DR 948 + +constexpr int something() { return 3; } + +int main() { + if (constexpr long v = something()) {} + if (static long v = something()) { } // { dg-error "decl-specifier invalid" } +} |