From 2be9999874fb71cd01519f096e5036a9959a603e Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 17 Oct 2018 07:32:15 +0000 Subject: [PATCH] re PR c++/84705 (internal compiler error: in add_stmt, at cp/semantics.c:390) /cp 2018-10-17 Paolo Carlini 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 PR c++/84705 * g++.dg/cpp0x/pr84705.C: New. From-SVN: r265233 --- gcc/cp/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr84705.C | 13 +++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr84705.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 701ec64cc07..f1541651e3d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2018-10-17 Paolo Carlini + + 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 * parser.h (struct cp_parser): Drop implicit_extern_c. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c1ba929f73..0f75b6d97dc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-10-17 Paolo Carlini + + PR c++/84705 + * g++.dg/cpp0x/pr84705.C: New. + 2018-10-17 Paul Thomas 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 index 00000000000..394e466b05d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr84705.C @@ -0,0 +1,13 @@ +// { dg-do compile { target c++11 } } +// { dg-options "" } + +int a[]{a}; // { dg-error "invalid conversion" } + +template +struct b { + __attribute__((c([] { + struct { + int a = static_cast(a); // { dg-error "invalid use of incomplete type" } + } e; + }))); +}; -- 2.30.2