> I'll also explain the reasoning behind our implementation, which is
> borne of practical needs as much as correctness:
>
> Language linkage specifications can only appear at namespace scope
> ([dcl.link]p4).
>
> So this is invalid:
> class ... {
>   friend extern "C" int bar(Foo *y);
> };
>
> Therefore pre-declaring the desired language linkage and retaining it in
> the friend declaration is the _only_ way to implement a friend function
> with different language linkage to its declaration context.

I think I agree. Even if this is not standard compliant, it seems a
useful gcc/msvc extension and less crazy than other extensions we
support.

Richard, do you see a case where supporting this extension (assuming
it is one) would break standard conformant code?

Cheers,
Rafael
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to