Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:21

0001 //===--- UseEqualsDefaultCheck.h - clang-tidy--------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DEFAULT_H
0010 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DEFAULT_H
0011 
0012 #include "../ClangTidyCheck.h"
0013 
0014 namespace clang::tidy::modernize {
0015 
0016 /// Replace default bodies of special member functions with '= default;'.
0017 /// \code
0018 ///   struct A {
0019 ///     A() {}
0020 ///     ~A();
0021 ///   };
0022 ///   A::~A() {}
0023 /// \endcode
0024 /// Is converted to:
0025 /// \code
0026 ///   struct A {
0027 ///     A() = default;
0028 ///     ~A();
0029 ///   };
0030 ///   A::~A() = default;
0031 /// \endcode
0032 ///
0033 /// For the user-facing documentation see:
0034 /// http://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html
0035 class UseEqualsDefaultCheck : public ClangTidyCheck {
0036 public:
0037   UseEqualsDefaultCheck(StringRef Name, ClangTidyContext *Context);
0038   bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
0039     return LangOpts.CPlusPlus11;
0040   }
0041   void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
0042   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
0043   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
0044 
0045 private:
0046   const bool IgnoreMacros;
0047 };
0048 
0049 } // namespace clang::tidy::modernize
0050 
0051 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DEFAULT_H