[clang] [Clang] Fix assertion failure when passing wide string literal to __builtin_nanf (PR #205452)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 08:08:31 PDT 2026


================
@@ -19999,6 +19999,8 @@ static bool TryEvaluateBuiltinNaN(const ASTContext &Context,
   const StringLiteral *S = dyn_cast<StringLiteral>(Arg->IgnoreParenCasts());
   if (!S) return false;
 
+  if (!S->isOrdinary() && !S->isUTF8()) return false;
----------------
AaronBallman wrote:

I think we only want ordinary string literals; I don't think we want to support `u8"whatever"` unless there are compelling use cases.

https://github.com/llvm/llvm-project/pull/205452


More information about the cfe-commits mailing list