Skip to content

Commit 5cbe8cb

Browse files
committed
Sema: Handle CGFloat <-> Double conversion in getOptionalEvaluationDepth()
1 parent 4ae57ac commit 5cbe8cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/CSApply.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5868,6 +5868,9 @@ static unsigned getOptionalEvaluationDepth(Expr *expr, Expr *target) {
58685868
depth += getOptionalEvaluationDepth(open->getSubExpr(),
58695869
open->getOpaqueValue());
58705870
expr = open->getExistentialValue();
5871+
} else if (auto call = dyn_cast<CallExpr>(expr)) {
5872+
// CGFloat <-> Double conversions lower to constructor calls.
5873+
expr = call->getArgs()->getExpr(0);
58715874

58725875
// Otherwise, look through implicit conversions.
58735876
} else {

0 commit comments

Comments
 (0)