2018-10-17 Paolo Carlini <paolo.carlini@oracle.com>
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 17 Oct 2018 07:34:28 +0000 (07:34 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 17 Oct 2018 07:34:28 +0000 (07:34 +0000)
* Fix typo in ChangeLog.

From-SVN: r265234

gcc/cp/ChangeLog
gcc/cp/tree.c

index f1541651e3d5810e152337fb5ae9300f7e7f7ebc..99595d9f3520072a7c6c809ab3f3f455cf16b628 100644 (file)
@@ -1,7 +1,7 @@
 2018-10-17  Paolo Carlini  <paolo.carlini@oracle.com>
 
        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.
 
index e74b79c44e06236daccc7eaf1e2daaac81b2e2a9..251c344f18157735d8a09b3d3917a95f5d947816 100644 (file)
@@ -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;