]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add test for DR 2126
authorMarek Polacek <polacek@redhat.com>
Mon, 19 Jul 2021 14:16:42 +0000 (10:16 -0400)
committerMarek Polacek <polacek@redhat.com>
Mon, 19 Jul 2021 14:16:52 +0000 (10:16 -0400)
DR 2126

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-temp2.C: New test.

gcc/testsuite/g++.dg/cpp0x/constexpr-temp2.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-temp2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-temp2.C
new file mode 100644 (file)
index 0000000..28ffd2c
--- /dev/null
@@ -0,0 +1,6 @@
+// DR 2126
+// { dg-do compile { target c++11 } }
+
+typedef const int CI[3];
+constexpr CI &ci = CI{11, 22, 33};
+static_assert(ci[1] == 22, "");