[cfe-commits] [PATCH] PR12299: Fix overload resolution for extern C

Richard Smith richard at metafoo.co.uk
Mon Dec 10 16:50:29 PST 2012


Hi,

Does your patch correct the behavior for this case too?

extern "C" { namespace N { int f(); } }
extern "C" void f();
using namespace N;
void g() { f(); }

(AFAICS, it won't, because the context for the first 'f' isn't a
LinkageDecl nor a function or method.) It seems like we want to add
*all* extern "C" declarations to the "LocallyScopedExternCDecls" map,
which makes me think we have the wrong representation.

On Mon, Dec 10, 2012 at 4:48 AM, Joey Gouly <joey.gouly at arm.com> wrote:
> Sorry, I attached an older version, this is the latest with an updated test
> case.
>
> Thanks,
> Joey
>
> -----Original Message-----
> From: cfe-commits-bounces at cs.uiuc.edu
> [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Joey Gouly
> Sent: 10 December 2012 11:53
> To: cfe-commits at cs.uiuc.edu; richard at metafoo.co.uk
> Subject: [cfe-commits] [PATCH] PR12299: Fix overload resolution for extern C
>
> Hi Richard et al,
>
> This patch fixes PR12299, by allowing MergeFunctionDecl to merge functions
> marked with extern "C".
> This is from 7.3.4.6 and 7.3.5 from the n3337 standard.
>
> Does this look like a reasonable fix?
>
> Thanks,
> Joey
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



More information about the cfe-commits mailing list