зеркало из https://github.com/microsoft/clang-1.git
Make sure C++ variable definitions are actually passed to the consumer when loaded from PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
156361d434
Коммит
3f95477f28
|
@ -1350,7 +1350,8 @@ static bool isConsumerInterestedIn(Decl *D) {
|
|||
if (isa<FileScopeAsmDecl>(D))
|
||||
return true;
|
||||
if (VarDecl *Var = dyn_cast<VarDecl>(D))
|
||||
return Var->isFileVarDecl() && Var->getInit();
|
||||
return Var->isFileVarDecl() &&
|
||||
Var->isThisDeclarationADefinition() == VarDecl::Definition;
|
||||
if (FunctionDecl *Func = dyn_cast<FunctionDecl>(D))
|
||||
return Func->isThisDeclarationADefinition();
|
||||
return isa<ObjCProtocolDecl>(D);
|
||||
|
|
|
@ -7,3 +7,4 @@
|
|||
|
||||
// CHECK: @_ZL5globS = internal global %struct.S zeroinitializer
|
||||
// CHECK: @_ZL3bar = internal global i32 0, align 4
|
||||
// CHECK: @glob_var = global i32 0
|
||||
|
|
|
@ -8,3 +8,5 @@ static S globS;
|
|||
|
||||
extern int ext_foo;
|
||||
static int bar = ++ext_foo;
|
||||
|
||||
int glob_var;
|
||||
|
|
Загрузка…
Ссылка в новой задаче