public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paolo Carlini <paolo.carlini@oracle.com>
To: Jason Merrill <jason@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ RFC / Patch] Again about PR 70202
Date: Thu, 09 Jun 2016 23:29:00 -0000	[thread overview]
Message-ID: <5759FBC7.5080503@oracle.com> (raw)
In-Reply-To: <CADzB+2m=+LHPwJSaZdVL1T+Pr+z9kdSBrN0OQY=eJX0sZrhNzw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

Hi,

On 09/06/2016 23:38, Jason Merrill wrote:
> I would think that when we see a duplicated base we should just drop
> the duplicates and continue.
>
> If the type of b1 is error_mark_node, why isn't the type of b2 also
> error_mark_node?
Thanks Jason. Normally check_initializer massages the decl basing on the 
init and so to speak transforms an error_mark_node as TREE_TYPE of the 
init into an error_mark_node as DECL_INITIAL of a reference. Thus we 
don't see error_mark_node as TREE_TYPE of b2. Now if I do something as 
trivial as the attached the testcase passes.

Next step, analyze the huge breakage caused by that change, I don't dare 
running the testsuite ;)

Thanks,
Paolo.

///////////////////



[-- Attachment #2: p --]
[-- Type: text/plain, Size: 533 bytes --]

Index: decl.c
===================================================================
--- decl.c	(revision 237280)
+++ decl.c	(working copy)
@@ -6002,6 +6002,12 @@ check_initializer (tree decl, tree init, int flags
   tree init_code = NULL;
   tree core_type;
 
+  if (TREE_TYPE (init) == error_mark_node)
+    {
+      TREE_TYPE (decl) = error_mark_node;
+      return NULL_TREE;
+    }
+
   /* Things that are going to be initialized need to have complete
      type.  */
   TREE_TYPE (decl) = type = complete_type (TREE_TYPE (decl));

  reply	other threads:[~2016-06-09 23:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 17:02 Paolo Carlini
2016-06-09 17:06 ` Jakub Jelinek
2016-06-09 21:39 ` Jason Merrill
2016-06-09 23:29   ` Paolo Carlini [this message]
2016-06-10  1:43     ` Paolo Carlini
2016-06-10 20:09       ` Jason Merrill
2016-06-10 20:15         ` Paolo Carlini
2016-06-10 20:30         ` Paolo Carlini
2016-06-10 20:34           ` Paolo Carlini
2016-06-10 20:48             ` Paolo Carlini
2016-06-11 16:06               ` [C++ Patch] PR 70202: avoid creating incomplete types (was: "[C++ RFC / Patch] Again about PR 70202") Paolo Carlini
2016-06-14 13:06                 ` [C++ Patch] PR 70202: avoid creating incomplete types Jason Merrill
2016-06-14 18:09                   ` Paolo Carlini
2016-06-14 19:29                     ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5759FBC7.5080503@oracle.com \
    --to=paolo.carlini@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).