clang-tools 20.0.0git
FuchsiaTidyModule.cpp
Go to the documentation of this file.
1//===--- FuchsiaTidyModule.cpp - clang-tidy -------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "../ClangTidy.h"
10#include "../ClangTidyModule.h"
11#include "../ClangTidyModuleRegistry.h"
12#include "../google/UnnamedNamespaceInHeaderCheck.h"
18#include "TrailingReturnCheck.h"
20
21using namespace clang::ast_matchers;
22
23namespace clang::tidy {
24namespace fuchsia {
25
26/// This module is for Fuchsia-specific checks.
28public:
29 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
31 "fuchsia-default-arguments-calls");
33 "fuchsia-default-arguments-declarations");
35 "fuchsia-header-anon-namespaces");
37 "fuchsia-multiple-inheritance");
39 "fuchsia-overloaded-operator");
41 "fuchsia-statically-constructed-objects");
42 CheckFactories.registerCheck<TrailingReturnCheck>(
43 "fuchsia-trailing-return");
45 "fuchsia-virtual-inheritance");
46 }
47};
48// Register the FuchsiaTidyModule using this statically initialized variable.
49static ClangTidyModuleRegistry::Add<FuchsiaModule>
50 X("fuchsia-module", "Adds Fuchsia platform checks.");
51} // namespace fuchsia
52
53// This anchor is used to force the linker to link in the generated object file
54// and thus register the FuchsiaModule.
56
57} // namespace clang::tidy
int X
A collection of ClangTidyCheckFactory instances.
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Default arguments are not allowed in called functions.
Default parameters are not allowed in declared functions.
This module is for Fuchsia-specific checks.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module.
Multiple implementation inheritance is discouraged.
Overloading operators is disallowed by the Fuchsia coding standard.
Constructing global, non-trivial objects with static storage is disallowed, unless the object is stat...
Functions that have trailing returns are disallowed, except for those using decltype specifiers and l...
Defining classes with virtual inheritance is disallowed.
volatile int FuchsiaModuleAnchorSource