This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 4.1.0 compile error
- From: Ian Lance Taylor <iant at google dot com>
- To: "Pranabesh Dash" <pranabesh dot dash at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 16 Mar 2007 14:35:24 -0700
- Subject: Re: GCC 4.1.0 compile error
- References: <47694070703161021v12b67ee3j144baf0459f428dd@mail.gmail.com> <47694070703161024h49462899od3df2cc1bc9b4ff1@mail.gmail.com>
"Pranabesh Dash" <pranabesh.dash@gmail.com> writes:
> The following piece of code compiles fine with 3.4.2, 4.0.0 but
> errors out on 4.1.0. Seems like a GCC bug. The friend function name
> is recognized if called as a function but does not work when used as
> a function pointer. An explicit function declaration (or definition
> reordered) is needed to get it to compile with 4.1.0.
>
> Do you believe this is a bug or a feature???
This is a feature. It is caused by closer conformance to the C++
standard. See the -ffriend-injection option and see "ARM-style
name-injection" in http://gcc.gnu.org/gcc-4.1/changes.html.
Ian