Index: clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp +++ clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp @@ -59,7 +59,8 @@ void BranchCloneCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( - ifStmt(stmt().bind("if"), + ifStmt(unless(allOf(isConstexpr(), isInTemplateInstantiation())), + stmt().bind("if"), hasParent(stmt(unless(ifStmt(hasElse(equalsBoundNode("if")))))), hasElse(stmt().bind("else"))), this); Index: clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp +++ clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp @@ -123,7 +123,10 @@ } void BracesAroundStatementsCheck::registerMatchers(MatchFinder *Finder) { - Finder->addMatcher(ifStmt().bind("if"), this); + Finder->addMatcher( + ifStmt(unless(allOf(isConstexpr(), isInTemplateInstantiation()))) + .bind("if"), + this); Finder->addMatcher(whileStmt().bind("while"), this); Finder->addMatcher(doStmt().bind("do"), this); Finder->addMatcher(forStmt().bind("for"), this); Index: clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp +++ clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp @@ -106,7 +106,11 @@ } void MisleadingIndentationCheck::registerMatchers(MatchFinder *Finder) { - Finder->addMatcher(ifStmt(hasElse(stmt())).bind("if"), this); + Finder->addMatcher( + ifStmt(unless(allOf(isConstexpr(), isInTemplateInstantiation())), + hasElse(stmt())) + .bind("if"), + this); Finder->addMatcher( compoundStmt(has(stmt(anyOf(ifStmt(), forStmt(), whileStmt())))) .bind("compound"),