summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-04-08 23:24:07 +0000
committerDouglas Gregor <dgregor@apple.com>2013-04-08 23:24:07 +0000
commitebe2db7ed6ebb92d54cc93a9d53f421ef08bfad8 (patch)
tree5cf3485532e71a29b9e8b6cdfa9cdc6a27402e78 /clang/lib/Sema/SemaOverload.cpp
parentcc9406c055e329dde1b1aeb610e449ae6981863a (diff)
downloadbcm5719-llvm-ebe2db7ed6ebb92d54cc93a9d53f421ef08bfad8.tar.gz
bcm5719-llvm-ebe2db7ed6ebb92d54cc93a9d53f421ef08bfad8.zip
<rdar://problem/13584715> Converted constant expressions are expected to have integral values.
We were assuming that any expression used as a converted constant expression would either not have a folded constant value or would be an integer, which is not the case for some ill-formed constant expressions. Because converted constant expressions are only used where integral values are expected, we can simply treat this as an error path. If that ever changes, we'll need to widen the interface of Sema::CheckConvertedConstantExpression() anyway. llvm-svn: 179068
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 805fdd8b578..22b2a4a57d7 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5024,7 +5024,7 @@ ExprResult Sema::CheckConvertedConstantExpression(Expr *From, QualType T,
Expr::EvalResult Eval;
Eval.Diag = &Notes;
- if (!Result.get()->EvaluateAsRValue(Eval, Context)) {
+ if (!Result.get()->EvaluateAsRValue(Eval, Context) || !Eval.Val.isInt()) {
// The expression can't be folded, so we can't keep it at this position in
// the AST.
Result = ExprError();
OpenPOWER on IntegriCloud