diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-delegating2.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-delegating2.C | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-delegating2.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-delegating2.C new file mode 100644 index 0000000..3543942 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-delegating2.C @@ -0,0 +1,28 @@ +// PR c++/51723 +// { dg-do compile { target c++11 } } + +template <int... V> +struct A +{ + static constexpr int a[sizeof...(V)] = { V... }; +}; + +template <int... V> constexpr int A<V...>::a[]; + +struct B +{ + const int* const b; + + template <unsigned int N> + constexpr B(const int(&b)[N]) + : b(b) + { } + + template <int... V> + constexpr B(A<V...>) + : B(A<V...>::a) + { } +}; + +constexpr B b1 = A<10, 20, 30>::a; +constexpr B b2 = A<10, 20, 30>(); |