extern "C" should preserve the 'extern' qualifier for VarDecls. Fixes 6853728.
llvm-svn: 71957
This commit is contained in:
@@ -538,8 +538,9 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
|
||||
assert(VD->isFileVarDecl() && "Cannot emit local var decl as global.");
|
||||
|
||||
// In C++, if this is marked "extern", defer code generation.
|
||||
if (getLangOptions().CPlusPlus &&
|
||||
VD->getStorageClass() == VarDecl::Extern && !VD->getInit())
|
||||
if (getLangOptions().CPlusPlus && !VD->getInit() &&
|
||||
(VD->getStorageClass() == VarDecl::Extern ||
|
||||
VD->isExternC(getContext())))
|
||||
return;
|
||||
|
||||
// In C, if this isn't a definition, defer code generation.
|
||||
|
||||
Reference in New Issue
Block a user