[C++,testcase] PR 55432

Submitted by Paolo Carlini on Nov. 22, 2012, 10:25 a.m.

Details

Message ID 50ADFD80.2050602@oracle.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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);