Skip to content

Conversation

@nicovank
Copy link
Contributor

@nicovank nicovank commented Apr 7, 2025

check_clang_tidy now matches full lines only, so {{^}} clauses are no longer necessary.

I am splitting those changes over multiple PRs to make review easier. Numbering them but the actual order doesn't matter.

@llvmbot
Copy link
Member

llvmbot commented Apr 7, 2025

@llvm/pr-subscribers-clang-tidy

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

Author: Nicolas van Kempen (nicovank)

Changes

check_clang_tidy now matches full lines only, so {{^}} clauses are no longer necessary.

I am splitting those changes over multiple PRs to make review easier. Numbering them but the actual order doesn't matter.


Patch is 73.33 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/134737.diff

11 Files Affected:

  • (modified) clang-tools-extra/test/clang-tidy/checkers/performance/for-range-copy.cpp (+7-9)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/performance/inefficient-algorithm.cpp (+17-17)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/performance/trivially-destructible.cpp (+3-3)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/performance/type-promotion-in-math-fn.cpp (+63-63)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/readability/delete-null-pointer.cpp (+10-10)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/readability/else-after-return-no-warn.cpp (+3-3)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-lower-case-prefix.cpp (+151-151)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-outofline.cpp (+3-3)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration-cxx17.cpp (+11-11)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration.c (+1-1)
  • (modified) clang-tools-extra/test/clang-tidy/checkers/readability/redundant-declaration-ignore-macros.cpp (+5-5)
diff --git a/clang-tools-extra/test/clang-tidy/checkers/performance/for-range-copy.cpp b/clang-tools-extra/test/clang-tidy/checkers/performance/for-range-copy.cpp
index 00e135bd2c920..0b5ef50fdbd7f 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/performance/for-range-copy.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/performance/for-range-copy.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy --match-partial-fixes %s performance-for-range-copy %t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy %s performance-for-range-copy %t -- -- -fno-delayed-template-parsing
 
 namespace std {
 
@@ -79,7 +79,7 @@ template <typename T>
 void uninstantiated() {
   for (const S S1 : View<Iterator<S>>()) {}
   // CHECK-MESSAGES: [[@LINE-1]]:16: warning: the loop variable's type is not a reference type; this creates a copy in each iteration; consider making this a reference [performance-for-range-copy]
-  // CHECK-FIXES: {{^}}  for (const S& S1 : View<Iterator<S>>()) {}
+  // CHECK-FIXES: for (const S& S1 : View<Iterator<S>>()) {}
 
   // Don't warn on dependent types.
   for (const T t1 : View<Iterator<T>>()) {
@@ -90,15 +90,15 @@ template <typename T>
 void instantiated() {
   for (const S S2 : View<Iterator<S>>()) {}
   // CHECK-MESSAGES: [[@LINE-1]]:16: warning: the loop variable's type is {{.*}}
-  // CHECK-FIXES: {{^}}  for (const S& S2 : View<Iterator<S>>()) {}
+  // CHECK-FIXES: for (const S& S2 : View<Iterator<S>>()) {}
 
   for (const auto [X, Y] : View<Iterator<Point>>()) {}
   // CHECK-MESSAGES: [[@LINE-1]]:19: warning: the loop variable's type is
-  // CHECK-FIXES: {{^}}  for (const auto& [X, Y] : View<Iterator<Point>>()) {}
+  // CHECK-FIXES: for (const auto& [X, Y] : View<Iterator<Point>>()) {}
 
   for (const T T2 : View<Iterator<T>>()) {}
   // CHECK-MESSAGES: [[@LINE-1]]:16: warning: the loop variable's type is {{.*}}
-  // CHECK-FIXES: {{^}}  for (const T& T2 : View<Iterator<T>>()) {}
+  // CHECK-FIXES: for (const T& T2 : View<Iterator<T>>()) {}
 }
 
 template <typename T>
@@ -311,10 +311,8 @@ View<Iterator<S>> createView(S) { return View<Iterator<S>>(); }
 
 void positiveValueIteratorUsedElseWhere() {
   for (const S SS : createView(*ValueReturningIterator<S>())) {
-    // CHECK-MESSAGES: [[@LINE-1]]:16: warning: the loop variable's type is not
-    // a reference type; this creates a copy in each iteration; consider making
-    // this a reference [performance-for-range-copy] CHECK-FIXES: for (const S&
-    // SS : createView(*ValueReturningIterator<S>())) {
+    // CHECK-MESSAGES: [[@LINE-1]]:16: warning: the loop variable's type is not a reference type; this creates a copy in each iteration; consider making this a reference [performance-for-range-copy]
+    // CHECK-FIXES: for (const S& SS : createView(*ValueReturningIterator<S>())) {
   }
 }
 
diff --git a/clang-tools-extra/test/clang-tidy/checkers/performance/inefficient-algorithm.cpp b/clang-tools-extra/test/clang-tidy/checkers/performance/inefficient-algorithm.cpp
index 19a6701c5b6aa..dafff8c946bb0 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/performance/inefficient-algorithm.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/performance/inefficient-algorithm.cpp
@@ -69,83 +69,83 @@ template <typename T> void f(const T &t) {
   std::set<int> s;
   find(s.begin(), s.end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}s.find(46);{{$}}
+  // CHECK-FIXES: s.find(46);
 
   find(t.begin(), t.end(), 46);
-  // CHECK-FIXES: {{^  }}find(t.begin(), t.end(), 46);{{$}}
+  // CHECK-FIXES: find(t.begin(), t.end(), 46);
 }
 
 int main() {
   std::set<int> s;
   auto it = std::find(s.begin(), s.end(), 43);
   // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: this STL algorithm call should be replaced with a container method [performance-inefficient-algorithm]
-  // CHECK-FIXES: {{^  }}auto it = s.find(43);{{$}}
+  // CHECK-FIXES: auto it = s.find(43);
   auto c = count(s.begin(), s.end(), 43);
   // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}auto c = s.count(43);{{$}}
+  // CHECK-FIXES: auto c = s.count(43);
 
 #define SECOND(x, y, z) y
   SECOND(q,std::count(s.begin(), s.end(), 22),w);
   // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}SECOND(q,s.count(22),w);{{$}}
+  // CHECK-FIXES: SECOND(q,s.count(22),w);
 
   it = find_if(s.begin(), s.end(), [](int) { return false; });
 
   std::multiset<int> ms;
   find(ms.begin(), ms.end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}ms.find(46);{{$}}
+  // CHECK-FIXES: ms.find(46);
 
   const std::multiset<int> &msref = ms;
   find(msref.begin(), msref.end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}msref.find(46);{{$}}
+  // CHECK-FIXES: msref.find(46);
 
   std::multiset<int> *msptr = &ms;
   find(msptr->begin(), msptr->end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}msptr->find(46);{{$}}
+  // CHECK-FIXES: msptr->find(46);
 
   it = std::find(s.begin(), s.end(), 43, std::greater<int>());
   // CHECK-MESSAGES: :[[@LINE-1]]:42: warning: different comparers used in the algorithm and the container [performance-inefficient-algorithm]
 
   FIND_IN_SET(s);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}FIND_IN_SET(s);{{$}}
+  // CHECK-FIXES: FIND_IN_SET(s);
 
   f(s);
 
   std::unordered_set<int> us;
   lower_bound(us.begin(), us.end(), 10);
-  // CHECK-FIXES: {{^  }}lower_bound(us.begin(), us.end(), 10);{{$}}
+  // CHECK-FIXES: lower_bound(us.begin(), us.end(), 10);
   find(us.begin(), us.end(), 10);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}us.find(10);{{$}}
+  // CHECK-FIXES: us.find(10);
 
   std::unordered_multiset<int> ums;
   find(ums.begin(), ums.end(), 10);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}ums.find(10);{{$}}
+  // CHECK-FIXES: ums.find(10);
 
   std::map<int, int> intmap;
   find(intmap.begin(), intmap.end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}find(intmap.begin(), intmap.end(), 46);{{$}}
+  // CHECK-FIXES: find(intmap.begin(), intmap.end(), 46);
 
   std::multimap<int, int> intmmap;
   find(intmmap.begin(), intmmap.end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}find(intmmap.begin(), intmmap.end(), 46);{{$}}
+  // CHECK-FIXES: find(intmmap.begin(), intmmap.end(), 46);
 
   std::unordered_map<int, int> umap;
   find(umap.begin(), umap.end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}find(umap.begin(), umap.end(), 46);{{$}}
+  // CHECK-FIXES: find(umap.begin(), umap.end(), 46);
 
   std::unordered_multimap<int, int> ummap;
   find(ummap.begin(), ummap.end(), 46);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}find(ummap.begin(), ummap.end(), 46);{{$}}
+  // CHECK-FIXES: find(ummap.begin(), ummap.end(), 46);
 }
 
 struct Value {
@@ -162,5 +162,5 @@ struct Ordering {
 void g(std::set<Value, Ordering> container, int value) {
   lower_bound(container.begin(), container.end(), value, Ordering());
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: this STL algorithm call should be
-  // CHECK-FIXES: {{^  }}lower_bound(container.begin(), container.end(), value, Ordering());{{$}}
+  // CHECK-FIXES: lower_bound(container.begin(), container.end(), value, Ordering());
 }
diff --git a/clang-tools-extra/test/clang-tidy/checkers/performance/trivially-destructible.cpp b/clang-tools-extra/test/clang-tidy/checkers/performance/trivially-destructible.cpp
index 2ff3eda559a52..40cf90d21467a 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/performance/trivially-destructible.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/performance/trivially-destructible.cpp
@@ -21,7 +21,7 @@ struct NotTriviallyDestructible1 : TriviallyDestructible2 {
 
 NotTriviallyDestructible1::~NotTriviallyDestructible1() = default; // to-be-removed
 // CHECK-MESSAGES: :[[@LINE-1]]:28: note: destructor definition is here
-// CHECK-FIXES: {{^}}// to-be-removed
+// CHECK-FIXES: // to-be-removed
 
 // Don't emit for class template with type-dependent fields.
 template <class T>
@@ -57,7 +57,7 @@ struct MaybeTriviallyDestructible1<T *> {
 template <class T>
 MaybeTriviallyDestructible1<T *>::~MaybeTriviallyDestructible1() noexcept = default; // to-be-removed
 // CHECK-MESSAGES: :[[@LINE-1]]:35: note: destructor definition is here
-// CHECK-FIXES: {{^}}// to-be-removed
+// CHECK-FIXES: // to-be-removed
 
 // Emit for explicit specializations.
 template <>
@@ -69,7 +69,7 @@ struct MaybeTriviallyDestructible1<double>: TriviallyDestructible1 {
 
 MaybeTriviallyDestructible1<double>::~MaybeTriviallyDestructible1() noexcept = default; // to-be-removed
 // CHECK-MESSAGES: :[[@LINE-1]]:38: note: destructor definition is here
-// CHECK-FIXES: {{^}}// to-be-removed
+// CHECK-FIXES: // to-be-removed
 
 struct NotTriviallyDestructible2 {
   virtual ~NotTriviallyDestructible2();
diff --git a/clang-tools-extra/test/clang-tidy/checkers/performance/type-promotion-in-math-fn.cpp b/clang-tools-extra/test/clang-tidy/checkers/performance/type-promotion-in-math-fn.cpp
index b2da7cc393a29..5309a1667d79a 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/performance/type-promotion-in-math-fn.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/performance/type-promotion-in-math-fn.cpp
@@ -67,169 +67,169 @@ void check_all_fns() {
 
   acos(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'acos' promotes float to double [performance-type-promotion-in-math-fn]
-  // CHECK-FIXES: {{^}}  std::acos(a);{{$}}
+  // CHECK-FIXES: std::acos(a);
   acosh(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'acosh'
-  // CHECK-FIXES: {{^}}  std::acosh(a);{{$}}
+  // CHECK-FIXES: std::acosh(a);
   asin(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'asin'
-  // CHECK-FIXES: {{^}}  std::asin(a);{{$}}
+  // CHECK-FIXES: std::asin(a);
   asinh(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'asinh'
-  // CHECK-FIXES: {{^}}  std::asinh(a);{{$}}
+  // CHECK-FIXES: std::asinh(a);
   atan2(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'atan2'
-  // CHECK-FIXES: {{^}}  std::atan2(a, b);{{$}}
+  // CHECK-FIXES: std::atan2(a, b);
   atan(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'atan'
-  // CHECK-FIXES: {{^}}  std::atan(a);{{$}}
+  // CHECK-FIXES: std::atan(a);
   atanh(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'atanh'
-  // CHECK-FIXES: {{^}}  std::atanh(a);{{$}}
+  // CHECK-FIXES: std::atanh(a);
   cbrt(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'cbrt'
-  // CHECK-FIXES: {{^}}  std::cbrt(a);{{$}}
+  // CHECK-FIXES: std::cbrt(a);
   ceil(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'ceil'
-  // CHECK-FIXES: {{^}}  std::ceil(a);{{$}}
+  // CHECK-FIXES: std::ceil(a);
   copysign(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'copysign'
-  // CHECK-FIXES: {{^}}  std::copysign(a, b);{{$}}
+  // CHECK-FIXES: std::copysign(a, b);
   cos(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'cos'
-  // CHECK-FIXES: {{^}}  std::cos(a);{{$}}
+  // CHECK-FIXES: std::cos(a);
   cosh(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'cosh'
-  // CHECK-FIXES: {{^}}  std::cosh(a);{{$}}
+  // CHECK-FIXES: std::cosh(a);
   erf(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'erf'
-  // CHECK-FIXES: {{^}}  std::erf(a);{{$}}
+  // CHECK-FIXES: std::erf(a);
   erfc(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'erfc'
-  // CHECK-FIXES: {{^}}  std::erfc(a);{{$}}
+  // CHECK-FIXES: std::erfc(a);
   exp2(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'exp2'
-  // CHECK-FIXES: {{^}}  std::exp2(a);{{$}}
+  // CHECK-FIXES: std::exp2(a);
   exp(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'exp'
-  // CHECK-FIXES: {{^}}  std::exp(a);{{$}}
+  // CHECK-FIXES: std::exp(a);
   expm1(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'expm1'
-  // CHECK-FIXES: {{^}}  std::expm1(a);{{$}}
+  // CHECK-FIXES: std::expm1(a);
   fabs(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'fabs'
-  // CHECK-FIXES: {{^}}  std::fabs(a);{{$}}
+  // CHECK-FIXES: std::fabs(a);
   fdim(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'fdim'
-  // CHECK-FIXES: {{^}}  std::fdim(a, b);{{$}}
+  // CHECK-FIXES: std::fdim(a, b);
   floor(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'floor'
-  // CHECK-FIXES: {{^}}  std::floor(a);{{$}}
+  // CHECK-FIXES: std::floor(a);
   fma(a, b, c);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'fma'
-  // CHECK-FIXES: {{^}}  std::fma(a, b, c);{{$}}
+  // CHECK-FIXES: std::fma(a, b, c);
   fmax(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'fmax'
-  // CHECK-FIXES: {{^}}  std::fmax(a, b);{{$}}
+  // CHECK-FIXES: std::fmax(a, b);
   fmin(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'fmin'
-  // CHECK-FIXES: {{^}}  std::fmin(a, b);{{$}}
+  // CHECK-FIXES: std::fmin(a, b);
   fmod(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'fmod'
-  // CHECK-FIXES: {{^}}  std::fmod(a, b);{{$}}
+  // CHECK-FIXES: std::fmod(a, b);
   frexp(a, int_ptr);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'frexp'
-  // CHECK-FIXES: {{^}}  std::frexp(a, int_ptr);{{$}}
+  // CHECK-FIXES: std::frexp(a, int_ptr);
   hypot(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'hypot'
-  // CHECK-FIXES: {{^}}  std::hypot(a, b);{{$}}
+  // CHECK-FIXES: std::hypot(a, b);
   ilogb(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'ilogb'
-  // CHECK-FIXES: {{^}}  std::ilogb(a);{{$}}
+  // CHECK-FIXES: std::ilogb(a);
   ldexp(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'ldexp'
-  // CHECK-FIXES: {{^}}  std::ldexp(a, b);{{$}}
+  // CHECK-FIXES: std::ldexp(a, b);
   lgamma(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'lgamma'
-  // CHECK-FIXES: {{^}}  std::lgamma(a);{{$}}
+  // CHECK-FIXES: std::lgamma(a);
   llrint(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'llrint'
-  // CHECK-FIXES: {{^}}  std::llrint(a);{{$}}
+  // CHECK-FIXES: std::llrint(a);
   llround(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'llround'
-  // CHECK-FIXES: {{^}}  std::llround(a);{{$}}
+  // CHECK-FIXES: std::llround(a);
   log10(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'log10'
-  // CHECK-FIXES: {{^}}  std::log10(a);{{$}}
+  // CHECK-FIXES: std::log10(a);
   log1p(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'log1p'
-  // CHECK-FIXES: {{^}}  std::log1p(a);{{$}}
+  // CHECK-FIXES: std::log1p(a);
   log2(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'log2'
-  // CHECK-FIXES: {{^}}  std::log2(a);{{$}}
+  // CHECK-FIXES: std::log2(a);
   log(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'log'
-  // CHECK-FIXES: {{^}}  std::log(a);{{$}}
+  // CHECK-FIXES: std::log(a);
   logb(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'logb'
-  // CHECK-FIXES: {{^}}  std::logb(a);{{$}}
+  // CHECK-FIXES: std::logb(a);
   lrint(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'lrint'
-  // CHECK-FIXES: {{^}}  std::lrint(a);{{$}}
+  // CHECK-FIXES: std::lrint(a);
   lround(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'lround'
-  // CHECK-FIXES: {{^}}  std::lround(a);{{$}}
+  // CHECK-FIXES: std::lround(a);
   nearbyint(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'nearbyint'
-  // CHECK-FIXES: {{^}}  std::nearbyint(a);{{$}}
+  // CHECK-FIXES: std::nearbyint(a);
   nextafter(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'nextafter'
-  // CHECK-FIXES: {{^}}  std::nextafter(a, b);{{$}}
+  // CHECK-FIXES: std::nextafter(a, b);
   nexttoward(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'nexttoward'
-  // CHECK-FIXES: {{^}}  std::nexttoward(a, b);{{$}}
+  // CHECK-FIXES: std::nexttoward(a, b);
   pow(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'pow'
-  // CHECK-FIXES: {{^}}  std::pow(a, b);{{$}}
+  // CHECK-FIXES: std::pow(a, b);
   remainder(a, b);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'remainder'
-  // CHECK-FIXES: {{^}}  std::remainder(a, b);{{$}}
+  // CHECK-FIXES: std::remainder(a, b);
   remquo(a, b, int_ptr);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'remquo'
-  // CHECK-FIXES: {{^}}  std::remquo(a, b, int_ptr);{{$}}
+  // CHECK-FIXES: std::remquo(a, b, int_ptr);
   rint(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'rint'
-  // CHECK-FIXES: {{^}}  std::rint(a);{{$}}
+  // CHECK-FIXES: std::rint(a);
   round(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'round'
-  // CHECK-FIXES: {{^}}  std::round(a);{{$}}
+  // CHECK-FIXES: std::round(a);
   scalbln(a, l);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'scalbln'
-  // CHECK-FIXES: {{^}}  std::scalbln(a, l);{{$}}
+  // CHECK-FIXES: std::scalbln(a, l);
   scalbn(a, i);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'scalbn'
-  // CHECK-FIXES: {{^}}  std::scalbn(a, i);{{$}}
+  // CHECK-FIXES: std::scalbn(a, i);
   sin(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'sin'
-  // CHECK-FIXES: {{^}}  std::sin(a);{{$}}
+  // CHECK-FIXES: std::sin(a);
   sinh(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'sinh'
-  // CHECK-FIXES: {{^}}  std::sinh(a);{{$}}
+  // CHECK-FIXES: std::sinh(a);
   sqrt(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'sqrt'
-  // CHECK-FIXES: {{^}}  std::sqrt(a);{{$}}
+  // CHECK-FIXES: std::sqrt(a);
   tan(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'tan'
-  // CHECK-FIXES: {{^}}  std::tan(a);{{$}}
+  // CHECK-FIXES: std::tan(a);
   tanh(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'tanh'
-  // CHECK-FIXES: {{^}}  std::tanh(a);{{$}}
+  // CHECK-FIXES: std::tanh(a);
   tgamma(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'tgamma'
-  // CHECK-FIXES: {{^}}  std::tgamma(a);{{$}}
+  // CHECK-FIXES: std::tgamma(a);
   trunc(a);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'trunc'
-  // CHECK-FIXES: {{^}}  std::trunc(a);{{$}}
+  // CHECK-FIXES: std::trunc(a);
 }
 
 // nexttoward/nexttowardf are weird -- the second param is always long double.
@@ -237,16 +237,16 @@ void check_all_fns() {
 void check_nexttoward() {
   nexttoward(0.f, 0);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'nexttoward'
-  // CHECK-FIXES: {{^}}  std::nexttoward(0.f, 0);{{$}}
+  // CHECK-FIXES: std::nexttoward(0.f, 0);
   nexttoward(0.f, 0l);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'nexttoward'
-  // CHECK-FIXES: {{^}}  std::nexttoward(0.f, 0l);{{$}}
+  // CHECK-FIXES: std::nexttoward(0.f, 0l);
   nexttoward(0.f, 0.f);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'nexttoward'
-  // CHECK-FIXES: {{^}}  std::nexttoward(0.f, 0.f);{{$}}
+  // CHECK-FIXES: std::nexttoward(0.f, 0.f);
   nexttoward(0.f, 0.);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'nexttoward'
-  // CHECK-FIXES: {{^}}  std::nexttoward(0.f, 0.);{{$}}
+  // CHECK-FIXES: std::nexttoward(0.f, 0.);
 
   // No warnings for these.
   nexttoward(0., 0);
@@ -259,10 +259,10 @@ void check_nexttoward() {
 void check_scalbn() {
   scalbn(0.f, 0);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'scalbn'
-  // CHECK-FIXES: {{^}}  std::scalbn(0.f, 0);{{$}}
+  // CHECK-FIXES: std::scalbn(0.f, 0);
   scalbn(0.f, static_cast<char>(0));
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'scalbn'
-  // CHECK-FIXES: {{^}}  std::scalbn(0.f, static_cast<char>(0));{{$}}
+  // CHECK-FIXES: std::scalbn(0.f, static_cast<char>(0));
 
   // No warnings for these.
   scalbn(0., 0);
@@ -275,10 +275,10 @@ void check_scalbn() {
 void check_scalbln() {
   scalbln(0.f, 0);
   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: call to 'scalbln'
-  // CHECK-FIXES: {{^}}  std::scalbln(0.f, 0);{{$}...
[truncated]

`check_clang_tidy` now matches full lines only, so `{{^}}` clauses are no longer necessary.

I am splitting those changes over multiple PRs to make review easier. Numbering them but the actual order doesn't matter.
Copy link
Contributor

@carlosgalvezp carlosgalvezp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nicovank nicovank merged commit 68383fc into llvm:main Apr 15, 2025
13 of 14 checks passed
@nicovank nicovank deleted the pr134737 branch April 15, 2025 17:42
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.

3 participants