================ @@ -0,0 +1,105 @@ +//===--- ComparePointerToMemberVirtualFunctionCheck.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 "ComparePointerToMemberVirtualFunctionCheck.h" +#include "clang/AST/ASTContext.h" +#include "clang/AST/ASTTypeTraits.h" +#include "clang/AST/DeclCXX.h" +#include "clang/AST/OperationKinds.h" +#include "clang/AST/Type.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/ASTMatchers/ASTMatchersMacros.h" +#include "clang/Basic/Diagnostic.h" +#include "clang/Basic/DiagnosticIDs.h" +#include "llvm/ADT/SmallVector.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::bugprone { + +namespace { + +AST_MATCHER(CXXMethodDecl, isVirtual) { return Node.isVirtual(); } + +static const char *const ErrorMsg = + "A pointer to member virtual function shall only be tested for equality " ---------------- PiotrZSL wrote:
start with small letter, maybe something with format like: "what's wrong, how should it be done" like: "comparing a pointer to the virtual method '%0' with other pointer, only compare it with a null-pointer constant for equality." https://github.com/llvm/llvm-project/pull/66055 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits