[all-commits] [llvm/llvm-project] 1f98c2: [clang-tidy] Disable Checks on If constexpr statem...

Nathan James via All-commits all-commits at lists.llvm.org
Wed Jan 22 16:00:56 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f98c2b586e4ebce68d75856699059663a052cb7
      https://github.com/llvm/llvm-project/commit/1f98c2b586e4ebce68d75856699059663a052cb7
  Author: Nathan <n.james93 at hotmail.co.uk>
  Date:   2020-01-23 (Thu, 23 Jan 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp
    M clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
    A clang-tools-extra/test/clang-tidy/checkers/bugprone-branch-clone-if-constexpr-template.cpp
    A clang-tools-extra/test/clang-tidy/checkers/readability-braces-around-statements-constexpr-if-templates.cpp

  Log Message:
  -----------
  [clang-tidy] Disable Checks on If constexpr statements in template Instantiations for BugproneBranchClone and ReadabilityBracesAroundStatements

Summary: fixes [[ https://bugs.llvm.org/show_bug.cgi?id=32203 | readability-braces-around-statements broken for if constexpr]] and [[ https://bugs.llvm.org/show_bug.cgi?id=44229 | bugprone-branch-clone false positive with template functions and constexpr ]] by disabling the relevant checks on if constexpr statements while inside an instantiated template. This is due to how the else branch of an if constexpr statement is folded away to a null statement if the condition evaluates to false

Reviewers: alexfh, hokein, aaron.ballman, xazax.hun

Reviewed By: aaron.ballman, xazax.hun

Subscribers: rnkovacs, JonasToth, Jim, lebedev.ri, xazax.hun, cfe-commits

Tags: #clang-tools-extra, #clang

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

(cherry picked from commit f9c46229e4ac29053747c96e08c574c6c48d544b)




More information about the All-commits mailing list