[cfe-commits] r89932 - in /cfe/trunk: lib/AST/Decl.cpp test/CodeGenCXX/const-global-linkage.cpp
Eli Friedman
eli.friedman at gmail.com
Wed Nov 25 19:04:02 PST 2009
Author: efriedma
Date: Wed Nov 25 21:04:01 2009
New Revision: 89932
URL: http://llvm.org/viewvc/llvm-project?rev=89932&view=rev
Log:
Slight tweak to the algorithm for getLinkage().
Modified:
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=89932&r1=89931&r2=89932&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Wed Nov 25 21:04:01 2009
@@ -232,7 +232,7 @@
// 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;
Modified: cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp?rev=89932&r1=89931&r2=89932&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/const-global-linkage.cpp Wed Nov 25 21:04:01 2009
@@ -6,3 +6,8 @@
// 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; }
More information about the cfe-commits
mailing list