Fix crash with UniqueExternalLinkage in extern "C" contexts

Rafael EspĂ­ndola rafael.espindola at
Mon Mar 11 18:02:39 PDT 2013

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 4245 bytes
Desc: not available
URL: <>

More information about the cfe-commits mailing list