Skip to content

Commit d36ef3f

Browse files
authored
Merge pull request #63915 from AtariDreams/std-math
Ensure the correct function is called by prepending std:: to the std math functions
2 parents 4d8723e + d132708 commit d36ef3f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13909,7 +13909,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
1390913909
// before matching base types if other side is an optional, so
1391013910
// score needs to account for number of such promotions.
1391113911
int optionalWraps = baseType2.getInt() - baseType1.getInt();
13912-
return recordFix(fix, baseImpact + abs(optionalWraps))
13912+
return recordFix(fix, baseImpact + std::abs(optionalWraps))
1391313913
? SolutionKind::Error
1391413914
: SolutionKind::Solved;
1391513915
};

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ExpressionTimer::~ExpressionTimer() {
8282

8383
if (PrintDebugTiming) {
8484
// Round up to the nearest 100th of a millisecond.
85-
llvm::errs() << llvm::format("%0.2f", ceil(elapsed * 100000) / 100)
85+
llvm::errs() << llvm::format("%0.2f", std::ceil(elapsed * 100000) / 100)
8686
<< "ms\t";
8787
if (auto *E = Anchor.dyn_cast<Expr *>()) {
8888
E->getLoc().print(llvm::errs(), Context.SourceMgr);

lib/Sema/TypeCheckStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ namespace {
173173

174174
if (ctx.TypeCheckerOpts.DebugTimeFunctionBodies) {
175175
// Round up to the nearest 100th of a millisecond.
176-
llvm::errs() << llvm::format("%0.2f", ceil(elapsed * 100000) / 100) << "ms\t";
176+
llvm::errs() << llvm::format("%0.2f", std::ceil(elapsed * 100000) / 100) << "ms\t";
177177
Function.getLoc().print(llvm::errs(), ctx.SourceMgr);
178178

179179
if (AFD) {

0 commit comments

Comments
 (0)