GCC 4.1.0 compile error

Ian Lance Taylor iant@google.com
Fri Mar 16 22:07:00 GMT 2007


"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



More information about the Gcc-help mailing list