[clang-tools-extra] [clang-tidy] Added check 'misc-visibility-change-to-virtual-function' (PR #140086)
Balázs Kéri via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 25 03:28:39 PDT 2025
================
@@ -0,0 +1,147 @@
+//===--- VisibilityChangeToVirtualFunctionCheck.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 "VisibilityChangeToVirtualFunctionCheck.h"
+#include "../utils/Matchers.h"
+#include "../utils/OptionsUtils.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+
+using namespace clang::ast_matchers;
+using namespace clang;
+
+namespace {
+AST_MATCHER(NamedDecl, isOperatorDecl) {
+ DeclarationName::NameKind NK = Node.getDeclName().getNameKind();
+ return NK != DeclarationName::Identifier &&
+ NK != DeclarationName::CXXConstructorName &&
+ NK != DeclarationName::CXXDestructorName;
+}
+} // namespace
+
+namespace clang::tidy {
+
+template <>
+struct OptionEnumMapping<
----------------
balazske wrote:
It is not convenient because it uses things from the `clang::tidy` namespace. (In other checkers these mappings are in `clang::tidy` too.)
https://github.com/llvm/llvm-project/pull/140086
More information about the cfe-commits
mailing list