<div class="gmail_quote">On Mon, Mar 11, 2013 at 7:01 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 11 March 2013 21:02, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
> Clang currently hits the assert in GetGVALinkageForVariable when compiling<br>
><br>
> namespace {<br>
>   struct X {};<br>
> }<br>
> extern "C" {<br>
>   X b = X();<br>
> }<br>
><br>
> The attached patch fixes it by propagating the linkage to variables,<br>
> even if they are extern "C". This seems consistent with how we handle<br>
> other interactions of language linkage and non-external linkage.<br>
<br>
</div></div>Sorry. Reading [basic.link] again I now think that the assert is just<br>
bogus. The standard talks about entities with C language linkage (and<br>
therefore external linkage) whose type has no linkage. It is<br>
reasonable to also accept types that have non-external linkage.<br>
<br>
The attached patch fixes it.</blockquote><div><br></div><div>LGTM. We're allowed (but not required) to emit an external symbol in this case; the lack of an external symbol doesn't seem like something worth asserting over.</div>
</div>