Patchwork [C++,testcase] PR 55432

login
register
mail settings
Submitter Paolo Carlini
Date Nov. 22, 2012, 10:25 a.m.
Message ID <50ADFD80.2050602@oracle.com>
Download mbox | patch
Permalink /patch/201035/
State New
Headers show

Comments

Paolo Carlini - Nov. 22, 2012, 10:25 a.m.
Hi,

tested x86_64-linux, committed to mainline.

Thanks,
Paolo.

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

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

Patch

Index: g++.dg/cpp0x/constexpr-55432.C
===================================================================
--- g++.dg/cpp0x/constexpr-55432.C	(revision 0)
+++ g++.dg/cpp0x/constexpr-55432.C	(working copy)
@@ -0,0 +1,22 @@ 
+// PR c++/55432
+// { dg-do compile { target c++11 } }
+
+struct tag_t{} tag{};
+
+constexpr tag_t const& pass(tag_t & t)
+{
+  return t;
+}
+
+struct S
+{
+  constexpr S(tag_t)  {};
+};
+
+struct T
+{
+  S mem;
+  T( tag_t & args ) : mem(pass(args)) {}
+};
+
+T t(tag);