This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Experience with g++ 4.8 and -frepo?
- From: David Kastrup <dak at gnu dot org>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: libstdc++ at gnu dot org
- Date: Wed, 27 Aug 2014 16:07:13 +0200
- Subject: Re: Experience with g++ 4.8 and -frepo?
- Authentication-results: sourceware.org; auth=none
- References: <87fvgi6xn5 dot fsf at fencepost dot gnu dot org> <20140827105915 dot GA22778 at redhat dot com> <87bnr66s7q dot fsf at fencepost dot gnu dot org> <20140827123351 dot GB22778 at redhat dot com> <877g1u6qjz dot fsf at fencepost dot gnu dot org> <20140827130403 dot GD22778 at redhat dot com>
Jonathan Wakely <jwakely@redhat.com> writes:
> On 27/08/14 14:54 +0200, David Kastrup wrote:
>>Ok. Once I get this thing through _without_ const, I'll try the version
>>_with_ const and see whether this indeed gets me rid of the optimization
>>problem too. After all, it's quite plausible that the optimizer might
>>confuse const on a generic definition with a promise that the value will
>>not get switched for a different constant by a specialization when the
>>actual specialization is only visible in a different compilation unit.
>
> If the specialization is only visible in a different compilation unit
> then any use of it is undefined behaviour, no diagnostic required, so
> any result is plausible. The 'const' is irrelevant.
Uh, by "visible" I mean "declared". The specialization cannot be
defined in more than one compilation unit. But it should obviously be
declared in all compilation units working with the particular template
instance that the specialization is for.
Aaaaaaand the jury is in. Compiler is off the hook as well. I'll just
mope about the incomprehensibility of the C++11 draft standard
precluding me from figuring out on my own what was needed. And of
course, once one has tried a dozen permutations of failing things, one
is pretty sure one had already tried the one thing that would have
worked. Or even if one did, stuff was set up to fail for another
reason.
Thanks again
--
David Kastrup