1 //===--- CleanupCtadCheck.h - clang-tidy ------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_CLEANUPCTADCHECK_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_CLEANUPCTADCHECK_H
12 #include "../utils/TransformerClangTidyCheck.h"
18 /// Suggests switching the initialization pattern of `absl::Cleanup`
19 /// instances from the factory function to class template argument
20 /// deduction (CTAD), in C++17 and higher.
22 /// For the user-facing documentation see:
23 /// http://clang.llvm.org/extra/clang-tidy/checks/abseil/cleanup-ctad.html
24 class CleanupCtadCheck
: public utils::TransformerClangTidyCheck
{
26 CleanupCtadCheck(StringRef Name
, ClangTidyContext
*Context
);
28 bool isLanguageVersionSupported(const LangOptions
&LangOpts
) const override
{
29 return LangOpts
.CPlusPlus17
;
37 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_CLEANUPCTADCHECK_H