diff options
author | Piotr Zegar <me@piotrzegar.pl> | 2024-06-09 09:01:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-09 09:01:41 +0200 |
commit | d211abc625cc7bbc8616885bb8eaf4a69a9a3853 (patch) | |
tree | 25e172cf7c8aa28adbf9170672298fdc60f2c3ba /clang-tools-extra/test/clang-tidy/checkers/readability | |
parent | cc8fa1e9206aa69197c891ca2f17b64340c5a6aa (diff) | |
download | llvm-d211abc625cc7bbc8616885bb8eaf4a69a9a3853.zip llvm-d211abc625cc7bbc8616885bb8eaf4a69a9a3853.tar.gz llvm-d211abc625cc7bbc8616885bb8eaf4a69a9a3853.tar.bz2 |
[clang-tidy] Ignore non-math operators in readability-math-missing-parentheses (#94654)
Do not emit warnings for non-math operators.
Closes #92516
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/readability')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/checkers/readability/math-missing-parentheses.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/math-missing-parentheses.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/math-missing-parentheses.cpp index a6045c0..4face0b 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/math-missing-parentheses.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/math-missing-parentheses.cpp @@ -140,3 +140,20 @@ void f(){ //CHECK-MESSAGES: :[[@LINE+1]]:13: warning: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses] int v = FUN5(0 + 1); } + +namespace PR92516 { + void f(int i) { + int j, k; + for (j = i + 1, k = 0; j < 1; ++j) {} + } + + void f2(int i) { + int j; + for (j = i + 1; j < 1; ++j) {} + } + + void f3(int i) { + int j; + for (j = i + 1, 2; j < 1; ++j) {} + } +} |