summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C
new file mode 100644
index 000000000..f34b98016
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C
@@ -0,0 +1,10 @@
+// { dg-options -std=c++0x }
+
+#include <initializer_list>
+
+constexpr auto list = { 1, 2, 3, 4 };
+
+#define SA(X) static_assert(X, #X)
+SA(list.size() == 4);
+SA(list.begin()[2] == 3);
+SA(list.end()[-1] == 4);