================ @@ -0,0 +1,141 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "MethodHidingCheck.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include <stack> + +using namespace clang::ast_matchers; + +namespace clang::tidy::bugprone { + +namespace { + +bool sameBasicType(ParmVarDecl const *Lhs, ParmVarDecl const *Rhs) { + if (Lhs && Rhs) { + return Lhs->getType() + .getCanonicalType() + .getNonReferenceType() + .getUnqualifiedType() == Rhs->getType() + .getCanonicalType() + .getNonReferenceType() + .getUnqualifiedType(); + } + return false; +} + +bool namesCollide(CXXMethodDecl const &Lhs, CXXMethodDecl const &Rhs) { + if (Lhs.getNameAsString() != Rhs.getNameAsString()) { + return false; + } ---------------- vbvictor wrote:
There is an option in `clang-format` for it https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removebracesllvm but It's not widely used due to instability I think. > Would a backwards readability-braces-around-statements check be accepted > upstream, with or without fixits? Pretty much yes, I was thinking of implementing it when I have more time. If you want to work on it - it would be great. > Reading around, there's a suggestion that removing brackets automatically is > considered bad practice. Is it somewhere in LLVM docs or generally in the web? Could you share a link? https://github.com/llvm/llvm-project/pull/154746 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits