A simple sample code involving templates, friends and lookup

Jonathan Wakely jwakely.gcc@gmail.com
Fri Jan 18 07:35:00 GMT 2008


On 18/01/2008, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
> Yes, at the point of instantiation of Foo<int> the friend is declared,
> and can then be found by ADL because Foo<int> is an associated type.
> The reference parameter 'x' doesn't cause an instantiation, only 'weird' does.

Forgot the reference - this is 14.6.5 [temp.inject]

DR387 fixes some errors in the example, but doesn't change the wording.
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#387

Jon



More information about the Gcc mailing list