File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ Potentially Breaking Changes
6969 - `CharTypdefsToIgnore ` to `CharTypedefsToIgnore ` in
7070 :doc: `bugprone-signed-char-misuse
7171 <clang-tidy/checks/bugprone/signed-char-misuse>`
72-
72+
7373- Modified the custom message format of :doc: `bugprone-unsafe-functions
7474 <clang-tidy/checks/bugprone/unsafe-functions>` by assigning a special meaning
7575 to the character ``> `` at the start of the value of the option
@@ -394,7 +394,7 @@ Changes in existing checks
394394 <clang-tidy/checks/bugprone/unhandled-self-assignment>` check by adding
395395 an additional matcher that generalizes the copy-and-swap idiom pattern
396396 detection.
397-
397+
398398- Improved :doc: `bugprone-unsafe-functions
399399 <clang-tidy/checks/bugprone/unsafe-functions>` check by hiding the default
400400 suffix when the reason starts with the character `> ` in the `CustomFunctions `
@@ -497,7 +497,8 @@ Changes in existing checks
497497- Improved :doc: `modernize-use-std-print
498498 <clang-tidy/checks/modernize/use-std-print>` check to correctly match
499499 when the format string is converted to a different type by an implicit
500- constructor call.
500+ constructor call, and fixed a crash when handling format strings
501+ containing non-ASCII characters.
501502
502503- Improved :doc: `performance-unnecessary-copy-initialization
503504 <clang-tidy/checks/performance/unnecessary-copy-initialization>` by printing
Original file line number Diff line number Diff line change @@ -54,6 +54,13 @@ void printf_deceptive_newline() {
5454 // CHECK-FIXES: std::println("Hello");
5555}
5656
57+ void printf_utf8_text () {
58+ // Non-ASCII UTF-8 in format string should not crash.
59+ printf (" 你好世界\n " );
60+ // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'printf' [modernize-use-std-print]
61+ // CHECK-FIXES: std::println("你好世界");
62+ }
63+
5764void printf_crlf_newline () {
5865 printf (" Hello\r\n " );
5966 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
@@ -303,6 +310,13 @@ void fprintf_simple() {
303310 // CHECK-FIXES: std::print(stderr, "Hello");
304311}
305312
313+ void fprintf_utf8_text () {
314+ // Non-ASCII UTF-8 in format string should not crash.
315+ fprintf (stderr, " 你好世界\n " );
316+ // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 'fprintf' [modernize-use-std-print]
317+ // CHECK-FIXES: std::println(stderr, "你好世界");
318+ }
319+
306320void std_printf_simple () {
307321 std::printf (" std::Hello" );
308322 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::print' instead of 'printf' [modernize-use-std-print]
You can’t perform that action at this time.
0 commit comments