================ @@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.cpp - clang-tidy-----------------===// +// +// 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 "MisleadingSetterOfReferenceCheck.h" +#include "clang/AST/ASTContext.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::bugprone { + +void MisleadingSetterOfReferenceCheck::registerMatchers(MatchFinder *Finder) { + auto RefField = + fieldDecl(unless(isPublic()), ---------------- NagyDonat wrote:
I agree that those cases (where a public reference member has a setter function with misleading type) are "twice buggy" (because public members should not have a setter function in any case), but this means that they are very unlikely to appear in the analyzed code, so we shouldn't complicate the behavior of this checker with extra code for it. As we discussed on the meeting, please remove the `unless(isPublic())` condition. https://github.com/llvm/llvm-project/pull/132242 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits