This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: (undocumented?) difference between gcc 4.6 and 4.7 (C++ implicit template instantiation)
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Christoph Groth <cwg at falma dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 28 Aug 2012 17:44:55 +0100
- Subject: Re: (undocumented?) difference between gcc 4.6 and 4.7 (C++ implicit template instantiation)
- References: <87vcg3c9rz.fsf@falma.de>
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*).