summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
new file mode 100644
index 000000000..e2328fcc5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
@@ -0,0 +1,9 @@
+// { dg-options -std=c++0x }
+// 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" }
+}