public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/44871] Invalid type mismatches while merging C and C++ sources
Date: Fri, 09 Jul 2010 13:01:00 -0000	[thread overview]
Message-ID: <20100709130113.20150.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44871-176@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from rguenth at gcc dot gnu dot org  2010-07-09 13:01 -------
The following seems to work at least for the testcase:

Index: gcc/tree.c
===================================================================
--- gcc/tree.c  (revision 161994)
+++ gcc/tree.c  (working copy)
@@ -4298,6 +4298,18 @@ free_lang_data_in_type (tree type)
     {
       tree prev, member;

+      if (strcmp (lang_hooks.name, "GNU C++") == 0)
+       {
+         /* If this isn't an implicit typedef then this final
+            non-typedef name is not a struct tag.  Clear its name.
+            See PR44871 for the glory details.  */
+         if (TYPE_NAME (type)
+             && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+             && !DECL_ORIGINAL_TYPE (TYPE_NAME (type))
+             /* DECL_IMPLICIT_TYPEDEF_P */
+             && !DECL_LANG_FLAG_2 (TYPE_NAME (type)))
+           TYPE_NAME (type) = NULL_TREE;
+       }
       /* Note that TYPE_FIELDS can be shared across distinct
         TREE_TYPEs.  Therefore, if the first field of TYPE_FIELDS is
         to be removed, we cannot set its TREE_CHAIN to NULL.

it will wreck debuginfo for T1 of course.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44871


  parent reply	other threads:[~2010-07-09 13:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-08 13:28 [Bug middle-end/44871] New: " hubicka at gcc dot gnu dot org
2010-07-08 13:31 ` [Bug middle-end/44871] " hubicka at gcc dot gnu dot org
2010-07-08 13:37 ` hubicka at gcc dot gnu dot org
2010-07-08 14:19 ` rguenth at gcc dot gnu dot org
2010-07-08 14:20 ` rguenth at gcc dot gnu dot org
2010-07-08 14:48 ` rguenth at gcc dot gnu dot org
2010-07-08 15:33 ` [Bug lto/44871] " rguenth at gcc dot gnu dot org
2010-07-09 12:42 ` [Bug c++/44871] " rguenth at gcc dot gnu dot org
2010-07-09 12:52 ` rguenth at gcc dot gnu dot org
2010-07-09 13:01 ` rguenth at gcc dot gnu dot org [this message]
     [not found] <bug-44871-4@http.gcc.gnu.org/bugzilla/>
2010-10-02 14:12 ` hubicka at gcc dot gnu.org
2010-10-15  2:39 ` hubicka at gcc dot gnu.org
2010-11-26 17:08 ` rguenth at gcc dot gnu.org
2010-11-26 17:20 ` rguenth at gcc dot gnu.org
2010-11-26 19:21 ` joseph at codesourcery dot com
2010-12-02 12:25 ` rguenth at gcc dot gnu.org
2010-12-02 12:25 ` rguenth at gcc dot gnu.org

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=20100709130113.20150.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).