Skip to content

Commit 1b5d088

Browse files
committed
[clang-tidy][NFC] update test name and config for bugprone-unintended-char-ostream-output
1 parent 7e1b76c commit 1b5d088

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %check_clang_tidy %s bugprone-unintended-char-ostream-output %t -- \
22
// RUN: -config="{CheckOptions: \
3-
// RUN: {bugprone-unintended-char-ostream-output.CastTypeName: "uint8_t"}}"
3+
// RUN: {bugprone-unintended-char-ostream-output.CastTypeName: \"unsigned char\"}}"
44

55
namespace std {
66

@@ -33,12 +33,12 @@ void origin_ostream(std::ostream &os) {
3333
unsigned char unsigned_value = 9;
3434
os << unsigned_value;
3535
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'unsigned char' passed to 'operator<<' outputs as character instead of integer
36-
// CHECK-FIXES: os << static_cast<uint8_t>(unsigned_value);
36+
// CHECK-FIXES: os << static_cast<unsigned char>(unsigned_value);
3737

3838
signed char signed_value = 9;
3939
os << signed_value;
4040
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'signed char' passed to 'operator<<' outputs as character instead of integer
41-
// CHECK-FIXES: os << static_cast<uint8_t>(signed_value);
41+
// CHECK-FIXES: os << static_cast<unsigned char>(signed_value);
4242

4343
char char_value = 9;
4444
os << char_value;

clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void based_on_ostream(A &os) {
5757
os << char_value;
5858
}
5959

60-
void based_on_ostream(std::basic_ostream<unsigned char> &os) {
60+
void other_ostream_template_parameters(std::basic_ostream<unsigned char> &os) {
6161
unsigned char unsigned_value = 9;
6262
os << unsigned_value;
6363

0 commit comments

Comments
 (0)