================
@@ -101,11 +101,14 @@ void PreferSingleCharOverloadsCheck::check(
if (!Replacement)
return;
- diag(Literal->getBeginLoc(), "%0 called with a string literal consisting of "
- "a single character; consider using the more "
- "efficient overload accepting a character")
- << FindFunc
- << FixItHint::CreateReplacement(Literal->getSourceRange(), *Replacement);
+ const auto Diag = diag(Literal->getBeginLoc(),
+ "%0 called with a string literal consisting of "
+ "a single character; consider using the more "
+ "efficient overload accepting a character")
+ << FindFunc;
+ if (!Literal->getBeginLoc().isMacroID() && !Literal->getEndLoc().isMacroID())
----------------
voyager-jhk wrote:
Addressed in the latest commit.
https://github.com/llvm/llvm-project/pull/227984
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits