[all-commits] [llvm/llvm-project] 498c88: [clang-tidy] Fix if-constexpr false-positive in re...

Piotr Zegar via All-commits all-commits at lists.llvm.org
Wed Mar 29 09:09:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 498c88563b7f6379d9e6ae4d89d182756fa1c0bc
      https://github.com/llvm/llvm-project/commit/498c88563b7f6379d9e6ae4d89d182756fa1c0bc
  Author: Piotr Zegar <me at piotrzegar.pl>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    A clang-tools-extra/test/clang-tidy/checkers/readability/misleading-indentation-cpp17.cpp

  Log Message:
  -----------
  [clang-tidy] Fix if-constexpr false-positive in readability-misleading-indentation

When  depend on template parameter,
compiler can use NullStmt instead of CompoundStmt.
This causes issues as we losing information about
end location of that Stmt. To avoid this issue
check now ignores ifStmt with NullStmt on true-branch.

Fixes: https://github.com/llvm/llvm-project/issues/61435

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D146887




More information about the All-commits mailing list