On Wed, Feb 20, 2013 at 5:22 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Feb 20, 2013 at 3:19 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Ping. Any preferences?</blockquote><div><br></div><div>Both patches seem like an improvement on the status quo to me. I'm waiting to hear opinions from CWG.</div></div></blockquote><div><br></div><div>OK, apparently CWG discussed and decided this 12 years ago.</div>
<div><br></div><div><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#4">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#4</a></div><div><br></div><div>I wonder how much code is actually broken by mangle_static_extern_c.patch. LLVM is probably not a representative measure here -- IIRC all the hits in LLVM code were in the JITs.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div>
On 15 February 2013 10:08, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>> wrote:<br>
> I have changed llvm so that it doesn't depend on the mangling of<br>
> static functions in extern C contexts. Now we should decide what to do<br>
> in clang.<br>
><br>
> I have attached two options on how to handle<br>
><br>
> extern "C" {<br>
>   static void foo();<br>
> }<br>
><br>
> The assign_c_language_linkage patch assigns C language linkage to any<br>
> function or variable with linkage, instead of just the ones with<br>
> external linkage. It looks like this is what gcc does.<br>
><br>
> The mangle_static_extern_c implements the current letter of the<br>
> standard, which requires some mangling of static functions. We can try<br>
> to improve it so that given<br>
><br>
> extern "C" {<br>
>   static void foo() {<br>
>   }<br>
>   static void bar() {<br>
>   }<br>
>   static void bar(int x) {<br>
>   }<br>
> }<br>
><br>
> it produces the symbols foo, _Z3barv and _Z3bari, but it doesn't look<br>
> trivial to find out in shouldMangleDeclName if a function is<br>
> overloaded or not.<br>
><br>
> Cheers,<br>
> Rafael<br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>