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

via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 13:44:18 PST 2024


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

(bad error message on incorrect string literal)

Fixed the error message for incorrect string literal

before:

test.cpp:1:19: error: invalid character '
' character in raw string delimiter; use PREFIX( )PREFIX to delimit raw string
char const* a = R"
                  ^

now:

test.cpp:1:19: error: invalid newline character in raw string delimiter; use PREFIX( )PREFIX to delimit raw string
    1 | char const* a = R"
      |                   ^


>From c2f716ee5f787ec3df63511fd5f565a3deee4d6e Mon Sep 17 00:00:00 2001
From: akshaykumars614 <akshaykumars614 at gmail.com>
Date: Tue, 13 Feb 2024 16:29:51 -0500
Subject: [PATCH] issue: #18079 (bad errwqor message on incorrect string
 literal)

Fixed the error message for incorrect string literal
---
 clang/include/clang/Basic/DiagnosticLexKinds.td | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td
index 75ca2fa16d3485..c5a2096d02b39d 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -100,7 +100,7 @@ def err_raw_delim_too_long : Error<
   "raw string delimiter longer than 16 characters"
   "; use PREFIX( )PREFIX to delimit raw string">;
 def err_invalid_char_raw_delim : Error<
-  "invalid character '%0' character in raw string delimiter"
+  "invalid newline character in raw string delimiter"
   "; use PREFIX( )PREFIX to delimit raw string">;
 def err_unterminated_raw_string : Error<
   "raw string missing terminating delimiter )%0\"">;



More information about the cfe-commits mailing list