A simple sample code involving templates, friends and lookup
Jonathan Wakely
jwakely.gcc@gmail.com
Sat Jan 19 08:21:00 GMT 2008
On 18/01/2008, Dragan Milenkovic <dragan@plusplus.co.yu> wrote:
>
> Thanks for clarification and info. I believe issue #34 addresses exactly
> what we're talking about.
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#34
Aha, yes ... but strangely that seems to have been closed as
Not-A-Defect for a long time: the templates book is newer and says the
standard isn't clear.
If the standard does clearly say an instantiation is required, GCC
should accept the code even without "weird" being declared, because
the call should cause an instantiation, and declare "func"
I'm ignoring the fact that func is only declared in your example, not
defined - to call it there must be a definition between the
declaration and point of instantiation - but turning the friend
declaration into a definition doesn't change GCC's behaviour.
I wonder why EDG rejects it .
> Hey... the current number of issues is kinda scary... :-O
Everyone has issues, even C++ :)
Jon
More information about the Gcc
mailing list