Skip to content

[clang-tidy][NFC] update test name and config for bugprone-unintended-char-ostream-output #134868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

HerrCai0907
Copy link
Contributor

No description provided.

Copy link
Contributor Author

HerrCai0907 commented Apr 8, 2025

@llvmbot
Copy link
Member

llvmbot commented Apr 8, 2025

@llvm/pr-subscribers-clang-tidy

@llvm/pr-subscribers-clang-tools-extra

Author: Congcong Cai (HerrCai0907)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/134868.diff

2 Files Affected:

  • (modified) clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp (+3-3)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp (+1-1)
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp
index faea4127ac44a..72020d90e0369 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp
@@ -1,6 +1,6 @@
 // RUN: %check_clang_tidy %s bugprone-unintended-char-ostream-output %t -- \
 // RUN:   -config="{CheckOptions: \
-// RUN:             {bugprone-unintended-char-ostream-output.CastTypeName: "uint8_t"}}"
+// RUN:             {bugprone-unintended-char-ostream-output.CastTypeName: \"unsigned char\"}}"
 
 namespace std {
 
@@ -33,12 +33,12 @@ void origin_ostream(std::ostream &os) {
   unsigned char unsigned_value = 9;
   os << unsigned_value;
   // CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'unsigned char' passed to 'operator<<' outputs as character instead of integer
-  // CHECK-FIXES: os << static_cast<uint8_t>(unsigned_value);
+  // CHECK-FIXES: os << static_cast<unsigned char>(unsigned_value);
 
   signed char signed_value = 9;
   os << signed_value;
   // CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'signed char' passed to 'operator<<' outputs as character instead of integer
-  // CHECK-FIXES: os << static_cast<uint8_t>(signed_value);
+  // CHECK-FIXES: os << static_cast<unsigned char>(signed_value);
 
   char char_value = 9;
   os << char_value;
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp
index 0a5cdeb21c01e..573c429bf049f 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp
@@ -57,7 +57,7 @@ void based_on_ostream(A &os) {
   os << char_value;
 }
 
-void based_on_ostream(std::basic_ostream<unsigned char> &os) {
+void other_ostream_template_parameters(std::basic_ostream<unsigned char> &os) {
   unsigned char unsigned_value = 9;
   os << unsigned_value;
 

Copy link
Contributor Author

HerrCai0907 commented Apr 8, 2025

Merge activity

  • Apr 8, 11:45 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 8, 11:46 AM EDT: A user merged this pull request with Graphite.

@HerrCai0907 HerrCai0907 merged commit bd49d27 into main Apr 8, 2025
11 of 15 checks passed
@HerrCai0907 HerrCai0907 deleted the users/ccc04-08-_clang-tidy_nfc_update_test_name_and_config_for_bugprone-unintended-char-ostream-output branch April 8, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants