(undocumented?) difference between gcc 4.6 and 4.7 (C++ implicit template instantiation)

Jonathan Wakely jwakely.gcc@gmail.com
Tue Aug 28 17:29:00 GMT 2012


On 28 August 2012 16:32, Christoph Groth wrote:
> Dear GCC experts,
>
> I've been unable to find a description of this issue in any changelog.
> Actually, I wonder whether the behavior of 4.6 or that of 4.7 is the
> correct one with regard to the C++ language standard.
>
> Is this a known issue which has been fixed in 4.7, or rather a
> regression from 4.6?

The change in behaviour might be due to the patch for
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48883

But I think the program has undefined behaviour according to
[expr.reinterpret.cast]/6, because it calls a function through a
pointer to a different function type.  Specifically, something<long>
which has type void*(Class<long>*) is called through a pointer of type
void*(*)(void*).



More information about the Gcc-help mailing list