Remove a bogus assert so we don't crash in
namespace { struct X {}; } extern "C" { X b = X(); } llvm-svn: 176866
This commit is contained in:
parent
e154c8f23e
commit
b3f4b978bb
|
@ -7629,8 +7629,6 @@ GVALinkage ASTContext::GetGVALinkageForVariable(const VarDecl *VD) {
|
|||
TSK = VD->getTemplateSpecializationKind();
|
||||
|
||||
Linkage L = VD->getLinkage();
|
||||
assert (!(L == ExternalLinkage && getLangOpts().CPlusPlus &&
|
||||
VD->getType()->getLinkage() == UniqueExternalLinkage));
|
||||
|
||||
switch (L) {
|
||||
case NoLinkage:
|
||||
|
|
|
@ -1,16 +1,28 @@
|
|||
// RUN: %clang_cc1 -emit-llvm %s -o %t
|
||||
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
||||
namespace foo {
|
||||
|
||||
// RUN: not grep "@a = global i32" %t
|
||||
// CHECK-NOT: @a = global i32
|
||||
extern "C" int a;
|
||||
|
||||
// RUN: not grep "@_ZN3foo1bE = global i32" %t
|
||||
// CHECK-NOT: @_ZN3foo1bE = global i32
|
||||
extern int b;
|
||||
|
||||
// RUN: grep "@_ZN3foo1cE = global i32" %t | count 1
|
||||
// CHECK: @_ZN3foo1cE = global i32
|
||||
int c = 5;
|
||||
|
||||
// RUN: not grep "@_ZN3foo1dE" %t
|
||||
// CHECK-NOT: @_ZN3foo1dE
|
||||
extern "C" struct d;
|
||||
|
||||
}
|
||||
|
||||
namespace test1 {
|
||||
namespace {
|
||||
struct X {};
|
||||
}
|
||||
extern "C" {
|
||||
// CHECK: @b = global
|
||||
X b = X();
|
||||
}
|
||||
void *use = &b;
|
||||
// CHECK: @_ZN5test13useE = global
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue