[PATCH] D27748: [clang-tidy] Suggest including <cmath> if necessary in type-promotion-in-math-fn-check.

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 13 22:05:25 PST 2016


alexfh accepted this revision.
alexfh added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp:187
 
-  diag(Call->getExprLoc(), "call to '%0' promotes float to double")
-      << OldFnName << FixItHint::CreateReplacement(
-                          Call->getCallee()->getSourceRange(), NewFnName);
+  auto D = diag(Call->getExprLoc(), "call to '%0' promotes float to double")
+           << OldFnName << FixItHint::CreateReplacement(
----------------
s/D/Diag/


================
Comment at: clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp:198
+            Result.Context->getSourceManager().getFileID(Call->getLocStart()),
+            "cmath", /* IsAngled = */ true))
+      D << *IncludeFixit;
----------------
Remove all spaces inside the argument comment, it's more common that way and clang-format understand it better.


https://reviews.llvm.org/D27748





More information about the cfe-commits mailing list