Re: New -ffriend-injection behavior - is it really intended?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Lohmann wrote:

> 3) How do you read from the standard that a friend function defined in a
> class *can* be found from the enclosing namespace (only) by argument
> dependent lookup (as stated in the -ffriend-injection documentation)?
> 
> 4) And finally, do you know the *intention* behind all this? I am trying to
> imagine a good reason for the g++ 4.1 interpretation, but haven't been able
> to find one so far. I mean, it is just not a strong point for some
> interpretation if it obviously does not make sense...

I think you can find some language-lawyering on the topic here:
<http://www.open-std.org/JTC1/sc22/wg21/docs/cwg_closed.html#95>.  As
far as I understand it, the original early C++ standard (Annotated C++
Reference/ARM) called for name injection, but this was changed during
the drafting of the formal ISO C++ spec, which is but one of a number of
incompatibilities between the two standards.  I'm not sure of the
rationale but if you dig around on the wg21 site you should be able to
find more.

The gcc bug report tracking the change:
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7874>.  Note that it was
actually a regression in gcc 3.x against 2.95 that was never reconciled
until 4.1.  So this really is nothing new at all, it's just that
removing functionality in a compiler requires a deprecation period and a
lot of waiting.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux