[clang] bad error message on incorrect string literal #18079 (PR #81670)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 13 13:45:06 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: None (akshaykumars614)
<details>
<summary>Changes</summary>
(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"
| ^
---
Full diff: https://github.com/llvm/llvm-project/pull/81670.diff
1 Files Affected:
- (modified) clang/include/clang/Basic/DiagnosticLexKinds.td (+1-1)
``````````diff
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\"">;
``````````
</details>
https://github.com/llvm/llvm-project/pull/81670
More information about the cfe-commits
mailing list