summaryrefslogtreecommitdiffstats
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-01-05 00:13:19 +0000
committerJohn McCall <rjmccall@apple.com>2012-01-05 00:13:19 +0000
commit73076431605556fdbf28d287d084a73a24a8b8d4 (patch)
treea3f64984f2c867b5ce2829cc31e50d3cf0563186 /lib/AST/Decl.cpp
parentc634f50c5cc892b899659c1743d696766c82afcd (diff)
The value of a const weak variable is not an integer constant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 479f80f1dd..468baae205 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1422,6 +1422,10 @@ bool VarDecl::evaluateValue(
}
bool VarDecl::checkInitIsICE() const {
+ // Initializers of weak variables are never ICEs.
+ if (isWeak())
+ return false;
+
EvaluatedStmt *Eval = ensureEvaluatedStmt();
if (Eval->CheckedICE)
// We have already checked whether this subexpression is an