[PATCH] PR17337 - Retain previous linkage of friend function declarations
alp at nuanti.com
Tue Sep 24 09:14:21 PDT 2013
gcc and MSVC both intentionally* retain the language linkage, and they
accept both test cases in the PR.
I already explained in PR17337 why this special handling is important,
and it becomes more so in the face of nested language linkage
The previous release of clang correctly accepted the code, just like
every other C++ compiler, up until checking was added in r171139 /
r181163 so this is a recent rejects-valid regression.
clang r171139 states "The language linkage of redeclarations must match.
GCC was already reporting an error for this."
If you don't feel comfortable reviewing this patch could you give others
a chance to take a look instead of marking the PR Invalid?
On 24/09/2013 14:43, Richard Smith wrote:
> On Tue, Sep 24, 2013 at 3:00 AM, Alp Toker <alp at nuanti.com
> <mailto:alp at nuanti.com>> wrote:
> The previous language linkage needs to be retained as described in
> [class.friend]p3 otherwise valid friend redeclarations differing
> only in
> lexical linkage are rejected.
> [class.friend]p3 says the previous linkage (internal/external/no
> linkage) is retained, not the previous language linkage. Our current
> behavior appears to be correct here.
> Fixes PR17337.
> the browser experts
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
the browser experts
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits