Slight tweak to the algorithm for getLinkage().

llvm-svn: 89932
This commit is contained in:
Eli Friedman 2009-11-26 03:04:01 +00:00
parent 8a5f75ed5d
commit f873c2fb68
2 changed files with 6 additions and 1 deletions

View File

@ -232,7 +232,7 @@ static NamedDecl::Linkage getLinkageForNamespaceScopeDecl(const NamedDecl *D) {
// declared to have external linkage; or
// (there is no equivalent in C99)
if (Context.getLangOptions().CPlusPlus &&
Var->getType().isConstQualified() &&
Var->getType().isConstant(Context) &&
Var->getStorageClass() != VarDecl::Extern &&
Var->getStorageClass() != VarDecl::PrivateExtern) {
bool FoundExtern = false;

View File

@ -6,3 +6,8 @@ const int y = 20;
// CHECK: @y = internal constant i32 20
const int& b() { return y; }
const char z1[] = "asdf";
const char z2[] = "zxcv";
// CHECK-NOT: @z1
// CHECK: @z2 = internal constant
const char* b2() { return z2; }