diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-05-11 18:26:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-05-11 18:26:10 +0000 |
commit | f73d5f23a889b93d89ddef61ac0995df40286bb8 (patch) | |
tree | c89fa0adefb99f464eba263b447f84c2ceb663ce /lib/Sema/SemaExprCXX.cpp | |
parent | 33fa48314f06936f83859852feb3c0ce68b08c0c (diff) |
Notes
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 07e465766b74..20118b57126d 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -5836,17 +5836,16 @@ static inline bool VariableCanNeverBeAConstantExpression(VarDecl *Var, assert(DefVD); if (DefVD->isWeak()) return false; EvaluatedStmt *Eval = DefVD->ensureEvaluatedStmt(); - + Expr *Init = cast<Expr>(Eval->Value); if (Var->getType()->isDependentType() || Init->isValueDependent()) { - if (!Init->isValueDependent()) - return !DefVD->checkInitIsICE(); - // FIXME: We might still be able to do some analysis of Init here - // to conclude that even in a dependent setting, Init can never - // be a constexpr - but for now admit agnosticity. + // FIXME: Teach the constant evaluator to deal with the non-dependent parts + // of value-dependent expressions, and use it here to determine whether the + // initializer is a potential constant expression. return false; - } + } + return !IsVariableAConstantExpression(Var, Context); } |