On Mon, Mar 11, 2013 at 11:21 PM, Richard Smith <[email protected]>wrote:

> On Mon, Mar 11, 2013 at 7:01 PM, Rafael Espíndola <
> [email protected]> wrote:
>
>> On 11 March 2013 21:02, Rafael Espíndola <[email protected]>
>> wrote:
>> > Clang currently hits the assert in GetGVALinkageForVariable when
>> compiling
>> >
>> > namespace {
>> >   struct X {};
>> > }
>> > extern "C" {
>> >   X b = X();
>> > }
>> >
>> > The attached patch fixes it by propagating the linkage to variables,
>> > even if they are extern "C". This seems consistent with how we handle
>> > other interactions of language linkage and non-external linkage.
>>
>> Sorry. Reading [basic.link] again I now think that the assert is just
>> bogus. The standard talks about entities with C language linkage (and
>> therefore external linkage) whose type has no linkage. It is
>> reasonable to also accept types that have non-external linkage.
>>
>> The attached patch fixes it.
>
>
> 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.
>

... and by "in this case" I mean for the remaining cases of the assert: a
non-extern-"C" external linkage variable with an unique-extern type. (In
the extern "C" case, we must emit an external symbol.)
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to