From: Jan Hubicka <hubicka@ucw.cz>
To: Jason Merrill <jason@redhat.com>
Cc: Jan Hubicka <hubicka@ucw.cz>, gcc-patches@gcc.gnu.org
Subject: Re: False ODR violation positives on anonymous namespace types
Date: Mon, 11 May 2015 17:46:00 -0000 [thread overview]
Message-ID: <20150511174607.GB59663@kam.mff.cuni.cz> (raw)
In-Reply-To: <5550E3D2.2080408@redhat.com>
> On 05/11/2015 09:28 AM, Jan Hubicka wrote:
> >We already discussed earlier that type_in_anonymous_namespace_p is not working
> >on compund types, because these do not have TYPE_STUB_DECL. I thought those are
> >!TYPE_NAME types. What is reason for !TYPE_NAME type with no TYPE_STUB_DECL?
> >Is it always a compound type with typedef name?
>
> Right. Typedef names have no linkage, so they aren't really ODR
> types; only classes and enums have linkage. Why do you want to
> check other types?
Well, my main motivatoin to extend from RECORD_OR_UNION_TYPE_P was to handle
enums. But other case I would like to deal with are integer types - i.e. preserve
difference between char/signed char/unsigned char/short/int/long/wchar in cases
where they structurally coincide.
This makes us to output better diagnostics on ODR violations caused by -fsigned-char
mismatches, but it also has some issues with fact that LTO forcingly merge char_type_node
no matter whetehr it agrees or disagress across units by preloading
https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01538.html
I can go with RECORD_OR_UNION_TYPE_P (..) || TREE_CODE (type) == ENUMERAL_TYPE
with comment that those types have linkage and other not, but we lose some checks.
Honza
>
> Jason
next prev parent reply other threads:[~2015-05-11 17:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 14:28 Jan Hubicka
2015-05-11 17:16 ` Jason Merrill
2015-05-11 17:46 ` Jan Hubicka [this message]
2015-05-11 17:54 ` Jason Merrill
2015-05-11 18:05 ` Jan Hubicka
2015-05-11 21:21 ` Jason Merrill
2015-05-11 21:52 ` Jan Hubicka
2015-05-12 13:51 ` Jason Merrill
2015-05-12 14:13 ` Jan Hubicka
2015-05-12 14:54 ` Jan Hubicka
2015-05-12 16:07 ` Jason Merrill
2015-05-12 16:27 ` Jan Hubicka
2015-05-12 18:40 ` Jan Hubicka
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=20150511174607.GB59663@kam.mff.cuni.cz \
--to=hubicka@ucw.cz \
--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).