blob: c663a12c40f5013fd2a14bd69555861209fabdd8 [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 {
17
18/// \brief Checks that all single-argument constructors are explicit.
19///
20/// see:
21/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors
22class 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
30} // namespace tidy
31} // namespace clang
32
Alexander Kornienko72f1e752014-06-18 09:33:46 +000033#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_EXPLICIT_CONSTRUCTOR_CHECK_H