re PR c++/67687 (ICE initializing constexpr member with constexpr constructor)
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 12 May 2017 11:24:56 +0000 (11:24 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 12 May 2017 11:24:56 +0000 (11:24 +0000)
2017-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/67687
* g++.dg/cpp0x/constexpr-ice17.C: New.

From-SVN: r247964

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

index b1c69d2959407326bf35292d8b06a1ffbe0ee7bd..c32d766d1951a0ff6be32769a2eecdc9bea2a9a8 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/67687
+       * g++.dg/cpp0x/constexpr-ice17.C: New.
+
 2017-05-12  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/80713
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice17.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice17.C
new file mode 100644 (file)
index 0000000..cbf7bf8
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/67687
+// { dg-do compile { target c++11 } }
+
+template <unsigned int Coordinate>
+struct dimension{
+    template<typename ... T>
+    constexpr dimension(T...){}
+};
+
+struct accessor_base{
+    template<typename ... T>
+    constexpr accessor_base(T...){}
+};
+
+template <typename ArgType, typename Pair>
+struct accessor_mixed{
+
+private:
+    static constexpr accessor_base s_args_constexpr{dimension<Pair::first>{0} };
+};