blob: 86501621f962f4d570ef83ceb9d74849e2650374 [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 Kornienko72f1e752014-06-18 09:33:46 +000010#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICIT_CONSTRUCTOR_CHECK_H
11#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICIT_CONSTRUCTOR_CHECK_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
19/// \brief Checks that all single-argument constructors are explicit.
20///
21/// see:
22/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors
23class ExplicitConstructorCheck : public ClangTidyCheck {
24public:
Alexander Kornienko6e0cbc82014-09-12 08:53:36 +000025 ExplicitConstructorCheck(StringRef Name, ClangTidyContext *Context)
26 : ClangTidyCheck(Name, Context) {}
Craig Toppera3dbe842014-03-02 10:20:11 +000027 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
Alexander Kornienko21f3b772014-03-05 13:01:24 +000028 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
Daniel Jasperd07c8402013-07-29 08:19:24 +000029};
30
Alexander Kornienkoed824e02015-03-05 13:46:14 +000031} // namespace google
Daniel Jasperd07c8402013-07-29 08:19:24 +000032} // namespace tidy
33} // namespace clang
34
Alexander Kornienko72f1e752014-06-18 09:33:46 +000035#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICIT_CONSTRUCTOR_CHECK_H