aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp b/clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp
index 7f4ccca..e1c1bee 100644
--- a/clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp
+++ b/clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp
@@ -207,13 +207,9 @@ FormatStringConverter::FormatStringConverter(
ArgsOffset(FormatArgOffset + 1), LangOpts(LO) {
assert(ArgsOffset <= NumArgs);
FormatExpr = llvm::dyn_cast<StringLiteral>(
- Args[FormatArgOffset]->IgnoreImplicitAsWritten());
+ Args[FormatArgOffset]->IgnoreUnlessSpelledInSource());
- if (!FormatExpr || !FormatExpr->isOrdinary()) {
- // Function must have a narrow string literal as its first argument.
- conversionNotPossible("first argument is not a narrow string literal");
- return;
- }
+ assert(FormatExpr && FormatExpr->isOrdinary());
if (const std::optional<StringRef> MaybeMacroName =
formatStringContainsUnreplaceableMacro(Call, FormatExpr, SM, PP);