re PR c++/57416 (internal compiler error: in gimple_expand_cfg, at cfgexpand.c:4575)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 12 Aug 2013 22:54:13 +0000 (22:54 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 12 Aug 2013 22:54:13 +0000 (22:54 +0000)
2013-08-12  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r201672

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr57416.C [new file with mode: 0644]

index 80ed59d..e6a2d8b 100644 (file)
@@ -1,5 +1,10 @@
 2013-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
 
+       PR c++/57416
+       * g++.dg/cpp0x/pr57416.C: New.
+
+2013-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
+
        * g++.dg/cpp0x/constexpr-function2.C: Adjust for error -> inform
        changes.
        * g++.dg/cpp0x/constexpr-neg1.C: Likewise.
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr57416.C b/gcc/testsuite/g++.dg/cpp0x/pr57416.C
new file mode 100644 (file)
index 0000000..104f1a7
--- /dev/null
@@ -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);
+}