diff options
| author | Haojian Wu <hokein@google.com> | 2016-05-09 13:43:58 +0000 |
|---|---|---|
| committer | Haojian Wu <hokein@google.com> | 2016-05-09 13:43:58 +0000 |
| commit | 11726686820358e49dba86b0ee07002bd54965b6 (patch) | |
| tree | 636353529305d03d0b492e080e3204d207883282 /clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.h | |
| parent | e473dc937f59a9fefe450725ca4774a5245826a2 (diff) | |
| download | bcm5719-llvm-11726686820358e49dba86b0ee07002bd54965b6.tar.gz bcm5719-llvm-11726686820358e49dba86b0ee07002bd54965b6.zip | |
[clang-tidy] new google-default-arguments check
Summary:
To check the google style guide rule here:
https://google.github.io/styleguide/cppguide.html#Default_Arguments
Patch by Clement Courbet!
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19534
llvm-svn: 268919
Diffstat (limited to 'clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.h')
| -rw-r--r-- | clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.h b/clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.h new file mode 100644 index 00000000000..1457a093db6 --- /dev/null +++ b/clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.h @@ -0,0 +1,34 @@ +//===--- DefaultArgumentsCheck.h - clang-tidy--------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_DEFAULT_ARGUMENTS_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_DEFAULT_ARGUMENTS_H + +#include "../ClangTidy.h" + +namespace clang { +namespace tidy { +namespace google { + +/// Checks that default parameters are not given for virtual methods. +/// +/// See https://google.github.io/styleguide/cppguide.html#Default_Arguments +class DefaultArgumentsCheck : public ClangTidyCheck { +public: + DefaultArgumentsCheck(StringRef Name, ClangTidyContext *Context) + : ClangTidyCheck(Name, Context) {} + void registerMatchers(ast_matchers::MatchFinder *Finder) override; + void check(const ast_matchers::MatchFinder::MatchResult &Result) override; +}; + +} // namespace google +} // namespace tidy +} // namespace clang + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_DEFAULT_ARGUMENTS_H |

