[PATCH] D146887: [clang-tidy] Fix if-constexpr false-positive in readability-misleading-indentation

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 28 13:17:46 PDT 2023


carlosgalvezp requested changes to this revision.
carlosgalvezp added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/readability/misleading-indentation.cpp:1
-// RUN: %check_clang_tidy %s readability-misleading-indentation %t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++17-or-later %s readability-misleading-indentation %t -- -- -fno-delayed-template-parsing
 
----------------
We should keep the default value of c++11-or-later, otherwise we are losing coverage on older versions.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/readability/misleading-indentation.cpp:199
+
+namespace PR61435 {
+
----------------
I believe the most common way of solving this is creating another test file where you test the c++17-or-later support. Alternatively you'd need to wrap this code in a #if block, plus create another RUN line with a different `check-suffix`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146887/new/

https://reviews.llvm.org/D146887



More information about the cfe-commits mailing list