This is the mail archive of the
mailing list for the GCC project.
Re: False ODR violation positives on anonymous namespace types
- From: Jason Merrill <jason at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 May 2015 09:50:15 -0400
- Subject: Re: False ODR violation positives on anonymous namespace types
- Authentication-results: sourceware.org; auth=none
- References: <20150511142810 dot GA6584 at kam dot mff dot cuni dot cz> <5550E3D2 dot 2080408 at redhat dot com> <20150511174607 dot GB59663 at kam dot mff dot cuni dot cz> <5550ECB5 dot 8000607 at redhat dot com> <20150511180509 dot GB22960 at kam dot mff dot cuni dot cz> <55511D40 dot 1010808 at redhat dot com> <20150511213949 dot GB35526 at kam dot mff dot cuni dot cz>
On 05/11/2015 04:39 PM, Jan Hubicka wrote:
What happens in LTO is that lto-symtab decide to merge the two declarations of
foo. At this time it has chance to output the warning. For that it needs to
be able to work out that these declarations are having different types, but
because LTO merge canonical types on structural basis, types_compatible_p
(long, int) will return true.
OK. So I guess it makes sense to check built-in integer types as well,
but compound types should be compared structurally.