Patchwork [C++,testcase,committed] PR 51723

login
register
mail settings
Submitter Paolo Carlini
Date Jan. 1, 2012, 1:31 p.m.
Message ID <4F006049.2040600@oracle.com>
Download mbox | patch
Permalink /patch/133757/
State New
Headers show

Comments

Paolo Carlini - Jan. 1, 2012, 1:31 p.m.
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.

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)
+  { }
+};