================
@@ -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());
----------------
mikecrowe wrote:

`FormatStringConverter` isn't capable of dealing with wide strings yet. It is 
my belief that the two checks that currently use it never match on wide 
strings. The assert is there to detect if that belief turns out to be incorrect 
(which it was before https://github.com/llvm/llvm-project/issues/92896 was 
fixed.)

Thanks for reviewing.


https://github.com/llvm/llvm-project/pull/142312
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to