From: Paolo Carlini Date: Wed, 17 Oct 2018 07:34:28 +0000 (+0000) Subject: 2018-10-17 Paolo Carlini X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cd1e244a1ced255fb0a5651bdab443fa254d9472;p=gcc.git 2018-10-17 Paolo Carlini * Fix typo in ChangeLog. From-SVN: r265234 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f1541651e3d..99595d9f352 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,7 +1,7 @@ 2018-10-17 Paolo Carlini PR c++/84705 - * init.c (build_cplus_new): Avoid duplicate diagnostic about + * tree.c (build_cplus_new): Avoid duplicate diagnostic about incomplete type, early return error_mark_node if the second argument is error_mark_node. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index e74b79c44e0..251c344f181 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -646,6 +646,9 @@ build_cplus_new (tree type, tree init, tsubst_flags_t complain) tree rval = build_aggr_init_expr (type, init); tree slot; + if (init == error_mark_node) + return error_mark_node; + if (!complete_type_or_maybe_complain (type, init, complain)) return error_mark_node;