NonCopyableObjects.h 1.1 KB

12345678910111213141516171819202122232425262728
  1. //===--- NonCopyableObjects.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. #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
  9. #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H
  10. #include "../ClangTidyCheck.h"
  11. namespace clang::tidy::misc {
  12. /// The check flags dereferences and non-pointer declarations of objects that
  13. /// are not meant to be passed by value, such as C FILE objects.
  14. class NonCopyableObjectsCheck : public ClangTidyCheck {
  15. public:
  16. NonCopyableObjectsCheck(StringRef Name, ClangTidyContext *Context)
  17. : ClangTidyCheck(Name, Context) {}
  18. void registerMatchers(ast_matchers::MatchFinder *Finder) override;
  19. void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
  20. };
  21. } // namespace clang::tidy::misc
  22. #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NONCOPYABLEOBJECTS_H