blob: 81e667902fd0202939c901f5c370e67633b0a73d [file] [log] [blame]
Alexander Kornienko72f1e752014-06-18 09:33:46 +00001//===--- ExplicitConstructorCheck.h - clang-tidy ----------------*- C++ -*-===//
Daniel Jasperd07c8402013-07-29 08:19:24 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Alexander Kornienko66580552015-03-09 16:52:33 +000010#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITCONSTRUCTORCHECK_H
11#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITCONSTRUCTORCHECK_H
Daniel Jasperd07c8402013-07-29 08:19:24 +000012
13#include "../ClangTidy.h"
14
15namespace clang {
16namespace tidy {
Alexander Kornienkoed824e02015-03-05 13:46:14 +000017namespace google {
Daniel Jasperd07c8402013-07-29 08:19:24 +000018
Alexander Kornienkof8ed0a82015-08-27 18:01:58 +000019/// Checks that all single-argument constructors are explicit.
Daniel Jasperd07c8402013-07-29 08:19:24 +000020///
Haojian Wubd639722016-02-25 14:31:10 +000021/// See https://google.github.io/styleguide/cppguide.html#Explicit_Constructors
Daniel Jasperd07c8402013-07-29 08:19:24 +000022class ExplicitConstructorCheck : public ClangTidyCheck {
23public:
Alexander Kornienko6e0cbc82014-09-12 08:53:36 +000024 ExplicitConstructorCheck(StringRef Name, ClangTidyContext *Context)
25 : ClangTidyCheck(Name, Context) {}
Craig Toppera3dbe842014-03-02 10:20:11 +000026 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
Alexander Kornienko21f3b772014-03-05 13:01:24 +000027 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
Daniel Jasperd07c8402013-07-29 08:19:24 +000028};
29
Alexander Kornienkoed824e02015-03-05 13:46:14 +000030} // namespace google
Daniel Jasperd07c8402013-07-29 08:19:24 +000031} // namespace tidy
32} // namespace clang
33
Alexander Kornienko66580552015-03-09 16:52:33 +000034#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICITCONSTRUCTORCHECK_H