Fix crash with UniqueExternalLinkage in extern "C" contexts

Rafael EspĂ­ndola rafael.espindola at gmail.com
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.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 4245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130311/4d09ba6d/attachment.obj>


More information about the cfe-commits mailing list