diff mbox

[C++,testcase,committed] PR 51723

Message ID 4F006049.2040600@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Jan. 1, 2012, 1:31 p.m. UTC
Hi,

I'm adding the testcase and closing the issue.

Thanks,
Paolo.

//////////////////////
2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51723
	* g++.dg/cpp0x/constexpr-delegating2.C: New.
diff mbox

Patch

Index: g++.dg/cpp0x/constexpr-delegating2.C
===================================================================
--- g++.dg/cpp0x/constexpr-delegating2.C	(revision 0)
+++ g++.dg/cpp0x/constexpr-delegating2.C	(revision 0)
@@ -0,0 +1,25 @@ 
+// PR c++/51723
+// { dg-options -std=c++0x }
+
+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)
+  { }
+};