clang-tools
20.0.0git
llvm-project
clang-tools-extra
clang-tidy
abseil
CleanupCtadCheck.h
Go to the documentation of this file.
1
//===--- CleanupCtadCheck.h - clang-tidy ------------------------*- C++ -*-===//
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
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_CLEANUPCTADCHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_CLEANUPCTADCHECK_H
11
12
#include "../utils/TransformerClangTidyCheck.h"
13
14
namespace
clang::tidy::abseil
{
15
16
/// Suggests switching the initialization pattern of `absl::Cleanup`
17
/// instances from the factory function to class template argument
18
/// deduction (CTAD), in C++17 and higher.
19
///
20
/// For the user-facing documentation see:
21
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/cleanup-ctad.html
22
class
CleanupCtadCheck
:
public
utils::TransformerClangTidyCheck
{
23
public
:
24
CleanupCtadCheck
(StringRef
Name
,
ClangTidyContext
*Context);
25
26
bool
isLanguageVersionSupported
(
const
LangOptions &LangOpts)
const override
{
27
return
LangOpts.CPlusPlus17;
28
}
29
};
30
31
}
// namespace clang::tidy::abseil
32
33
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_CLEANUPCTADCHECK_H
Name
llvm::SmallString< 256U > Name
Definition:
ChainedComparisonCheck.cpp:42
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:69
clang::tidy::abseil::CleanupCtadCheck
Suggests switching the initialization pattern of absl::Cleanup instances from the factory function to...
Definition:
CleanupCtadCheck.h:22
clang::tidy::abseil::CleanupCtadCheck::isLanguageVersionSupported
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Override this to disable registering matchers and PP callbacks if an invalid language version is bein...
Definition:
CleanupCtadCheck.h:26
clang::tidy::utils::TransformerClangTidyCheck
A base class for defining a ClangTidy check based on a RewriteRule.
Definition:
TransformerClangTidyCheck.h:38
clang::tidy::abseil
Definition:
AbseilTidyModule.cpp:33
Generated on Sat Oct 12 2024 16:37:18 for clang-tools by
1.9.6