[clang-tools-extra] r251244 - [clang-tidy] Another fix for failing buildbots regarding signedness of char

Piotr Dziwinski via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 25 10:11:14 PDT 2015


Author: piotrdz
Date: Sun Oct 25 12:11:13 2015
New Revision: 251244

URL: http://llvm.org/viewvc/llvm-project?rev=251244&view=rev
Log:
[clang-tidy] Another fix for failing buildbots regarding signedness of char

I totally forgot that char can be defined as unsigned on some platforms.
Now I made explicit mention of signed type where necessary in tests.

Also fixed '//RUN: ' header of cxx98 test to correct format.

Modified:
    clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast-cxx98.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast.cpp

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast-cxx98.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast-cxx98.cpp?rev=251244&r1=251243&r2=251244&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast-cxx98.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast-cxx98.cpp Sun Oct 25 12:11:13 2015
@@ -1,4 +1,4 @@
-// RUN: clang-tidy %s -checks=-*,readability-implicit-bool-cast -- -std=c++98
+// RUN: %check_clang_tidy %s readability-implicit-bool-cast %t -- -- -std=c++98
 
 // We need NULL macro, but some buildbots don't like including <cstddef> header
 // This is a portable way of getting it to work

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast.cpp?rev=251244&r1=251243&r2=251244&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-implicit-bool-cast.cpp Sun Oct 25 12:11:13 2015
@@ -94,9 +94,9 @@ void implicitCastFromBoolLiterals() {
   // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: implicit cast bool -> 'unsigned long'
   // CHECK-FIXES: functionTaking<unsigned long>(0u);
 
-  functionTaking<char>(true);
-  // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: implicit cast bool -> 'char'
-  // CHECK-FIXES: functionTaking<char>(1);
+  functionTaking<signed char>(true);
+  // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: implicit cast bool -> 'signed char'
+  // CHECK-FIXES: functionTaking<signed char>(1);
 
   functionTaking<float>(false);
   // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: implicit cast bool -> 'float'
@@ -183,9 +183,9 @@ void implicitCastToBoolSimpleCases() {
   // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: implicit cast 'double' -> bool
   // CHECK-FIXES: functionTaking<bool>(doubleFloating != 0.0);
 
-  char character = 'a';
+  signed char character = 'a';
   functionTaking<bool>(character);
-  // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: implicit cast 'char' -> bool
+  // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: implicit cast 'signed char' -> bool
   // CHECK-FIXES: functionTaking<bool>(character != 0);
 
   int* pointer = nullptr;
@@ -210,9 +210,9 @@ void implicitCastToBoolInSingleExpressio
   // CHECK-MESSAGES: :[[@LINE-1]]:30: warning: implicit cast 'float' -> bool
   // CHECK-FIXES: bool boolComingFromFloat = floating != 0.0f;
 
-  char character = 'a';
+  signed char character = 'a';
   bool boolComingFromChar = character;
-  // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: implicit cast 'char' -> bool
+  // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: implicit cast 'signed char' -> bool
   // CHECK-FIXES: bool boolComingFromChar = character != 0;
 
   int* pointer = nullptr;
@@ -252,9 +252,9 @@ void implicitCastInNegationExpressions()
   // CHECK-MESSAGES: :[[@LINE-1]]:39: warning: implicit cast 'float' -> bool
   // CHECK-FIXES: bool boolComingFromNegatedFloat = floating == 0.0f;
 
-  char character = 'a';
+  signed char character = 'a';
   bool boolComingFromNegatedChar = (! character);
-  // CHECK-MESSAGES: :[[@LINE-1]]:39: warning: implicit cast 'char' -> bool
+  // CHECK-MESSAGES: :[[@LINE-1]]:39: warning: implicit cast 'signed char' -> bool
   // CHECK-FIXES: bool boolComingFromNegatedChar = (character == 0);
 
   int* pointer = nullptr;




More information about the cfe-commits mailing list