This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Experience with g++ 4.8 and -frepo?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]