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

login
register
mail settings
Submitter Paolo Carlini
Date Aug. 12, 2013, 10:55 p.m.
Message ID <520967D8.4000703@oracle.com>
Download mbox | patch
Permalink /patch/266654/
State New
Headers show

Comments

Paolo Carlini - Aug. 12, 2013, 10:55 p.m.
Hi,

tested x86_64-linux, committed to mainline.

Thanks,
Paolo.

///////////////////////////
2013-08-12  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/57416
	* g++.dg/cpp0x/pr57416.C: New.

Patch

Index: g++.dg/cpp0x/pr57416.C
===================================================================
--- g++.dg/cpp0x/pr57416.C	(revision 0)
+++ g++.dg/cpp0x/pr57416.C	(working copy)
@@ -0,0 +1,45 @@ 
+// PR c++/57416
+// { dg-do compile { target c++11 } }
+
+struct Nothing
+{
+};
+
+template <class PARENTDATA>
+void func3 (PARENTDATA & p_parent_data)
+{
+  struct Data
+  {
+    PARENTDATA & parent_data = p_parent_data;  // { dg-error "parameter" }
+  } data;
+}
+
+template <class PARENTDATA>
+void func2 (PARENTDATA & p_parent_data)
+{
+  struct Data
+  {
+    PARENTDATA & parent_data = p_parent_data;  // { dg-error "parameter" }
+  } data;
+
+  data.parent_data.x = 5;
+  func3(data);
+}
+
+template <class PARENTDATA>
+void func1 (PARENTDATA & p_parent_data)
+{
+  struct Data
+  {
+    PARENTDATA & parent_data = p_parent_data;  // { dg-error "parameter" }
+    int x = 1;
+  } data;
+
+  func2(data);
+}
+
+int main()
+{
+  Nothing nothing;
+  func1(nothing);
+}