[clang] bad error message on incorrect string literal #18079 (PR #81670)

Jon Roelofs via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 11:17:50 PST 2024


================
@@ -2270,9 +2270,11 @@ bool Lexer::LexRawStringLiteral(Token &Result, const char *CurPtr,
       const char *PrefixEnd = &CurPtr[PrefixLen];
       if (PrefixLen == 16) {
         Diag(PrefixEnd, diag::err_raw_delim_too_long);
-      } else {
+      } else if (*PrefixEnd != '\n') {
----------------
jroelofs wrote:

Might make more sense to flip the condition, and swap the else-if/else cases.

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


More information about the cfe-commits mailing list