re PR c++/84705 (internal compiler error: in add_stmt, at cp/semantics.c:390)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 17 Oct 2018 07:32:15 +0000 (07:32 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 17 Oct 2018 07:32:15 +0000 (07:32 +0000)
/cp
2018-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84705
* init.c (build_cplus_new): Avoid duplicate diagnostic about
incomplete type, early return error_mark_node if the second
argument is error_mark_node.

/testsuite
2018-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84705
* g++.dg/cpp0x/pr84705.C: New.

From-SVN: r265233

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

index 701ec64cc0743167b8ed74faeed0be64952ec16b..f1541651e3d5810e152337fb5ae9300f7e7f7ebc 100644 (file)
@@ -1,3 +1,10 @@
+2018-10-17  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84705
+       * init.c (build_cplus_new): Avoid duplicate diagnostic about
+       incomplete type, early return error_mark_node if the second
+       argument is error_mark_node.
+
 2018-10-12  Nathan Sidwell  <nathan@acm.org>
 
        * parser.h (struct cp_parser): Drop implicit_extern_c.
index 6c1ba929f733aa9820b2e5030bb0b3563e25a86b..0f75b6d97dcc974e7b4e7c5e3f28cf174c9725a2 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-17  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84705
+       * g++.dg/cpp0x/pr84705.C: New.
+
 2018-10-17  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/56386
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr84705.C b/gcc/testsuite/g++.dg/cpp0x/pr84705.C
new file mode 100644 (file)
index 0000000..394e466
--- /dev/null
@@ -0,0 +1,13 @@
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+int a[]{a};  // { dg-error "invalid conversion" }
+
+template<int>
+struct b {
+  __attribute__((c([] {
+    struct {
+      int a = static_cast<struct d>(a);  // { dg-error "invalid use of incomplete type" }
+    } e;
+  })));
+};