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. Cheers, Rafael
t.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
