diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-03-16 22:31:16 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-03-16 22:31:16 +0000 |
commit | c5bc68e7ab51d34e2edfad8c883b55e433bed9bd (patch) | |
tree | 20e8246d7720b10d85abd4b47cb07ab98d3d6371 /clang-tools-extra/test/clang-tidy/google-readability-function.cpp | |
parent | 55cfaa255232d95d984fb143e06fd530a8a243a7 (diff) | |
download | bcm5719-llvm-c5bc68e7ab51d34e2edfad8c883b55e433bed9bd.tar.gz bcm5719-llvm-c5bc68e7ab51d34e2edfad8c883b55e433bed9bd.zip |
[clang-tidy] Move google-readability-function check to readability-named-parameter.
Summary: The relevant style rule is going to be removed, thus the check is no longer needed in the Google module. Leaving the check in readability/ in case someone needs it.
Reviewers: djasper
Reviewed By: djasper
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D8261
llvm-svn: 232431
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/google-readability-function.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/google-readability-function.cpp | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/clang-tools-extra/test/clang-tidy/google-readability-function.cpp b/clang-tools-extra/test/clang-tidy/google-readability-function.cpp deleted file mode 100644 index 9876f97a1a5..00000000000 --- a/clang-tools-extra/test/clang-tidy/google-readability-function.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-function %t -// REQUIRES: shell - -void Method(char *) { /* */ } -// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: all parameters should be named in a function -// CHECK-FIXES: void Method(char * /*unused*/) { /* */ } -void Method2(char *) {} -// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: all parameters should be named in a function -// CHECK-FIXES: void Method2(char * /*unused*/) {} -void Method3(char *, void *) {} -// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: all parameters should be named in a function -// CHECK-FIXES: void Method3(char * /*unused*/, void * /*unused*/) {} -void Method4(char *, int /*unused*/) {} -// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: all parameters should be named in a function -// CHECK-FIXES: void Method4(char * /*unused*/, int /*unused*/) {} -void operator delete[](void *) throw() {} -// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: all parameters should be named in a function -// CHECK-FIXES: void operator delete[](void * /*unused*/) throw() {} -int Method5(int) { return 0; } -// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: all parameters should be named in a function -// CHECK-FIXES: int Method5(int /*unused*/) { return 0; } -void Method6(void (*)(void *)) {} -// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: all parameters should be named in a function -// CHECK-FIXES: void Method6(void (* /*unused*/)(void *)) {} -template <typename T> void Method7(T) {} -// CHECK-MESSAGES: :[[@LINE-1]]:37: warning: all parameters should be named in a function -// CHECK-FIXES: template <typename T> void Method7(T /*unused*/) {} - -// Don't warn in macros. -#define M void MethodM(int) {} -M - -void operator delete(void *x) throw() {} -void Method7(char * /*x*/) {} -void Method8(char *x) {} -typedef void (*TypeM)(int x); -void operator delete[](void *x) throw(); -void operator delete[](void * /*x*/) throw(); - -struct X { - X operator++(int) {} - X operator--(int) {} - - X(X&) = delete; - X &operator=(X&) = default; - - const int &i; -}; - -void (*Func1)(void *); -void Func2(void (*func)(void *)) {} -template <void Func(void *)> void Func3() {} - -template <typename T> -struct Y { - void foo(T) {} -// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: all parameters should be named in a function -// CHECK-FIXES: void foo(T /*unused*/) {} -}; - -Y<int> y; -Y<float> z; - -struct Base { - virtual void foo(bool notThisOne); - virtual void foo(int argname); -}; - -struct Derived : public Base { - void foo(int); -// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: all parameters should be named in a function -// CHECK-FIXES: void foo(int /*argname*/); -}; - -void FDef(int); -// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: all parameters should be named in a function -// CHECK-FIXES: void FDef(int /*n*/); -void FDef(int n) {} - -void FDef2(int, int); -// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: all parameters should be named in a function -// CHECK-FIXES: void FDef2(int /*n*/, int /*unused*/); -void FDef2(int n, int) {} -// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: all parameters should be named in a function -// CHECK-FIXES: void FDef2(int n, int /*unused*/) {} - -void FNoDef(int); - -class Z {}; - -Z &operator++(Z&) {} -// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: all parameters should be named in a function -// CHECK-FIXES: Z &operator++(Z& /*unused*/) {} - -Z &operator++(Z&, int) {} -// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: all parameters should be named in a function -// CHECK-FIXES: Z &operator++(Z& /*unused*/, int) {} - -Z &operator--(Z&) {} -// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: all parameters should be named in a function -// CHECK-FIXES: Z &operator--(Z& /*unused*/) {} - -Z &operator--(Z&, int) {} -// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: all parameters should be named in a function -// CHECK-FIXES: Z &operator--(Z& /*unused*/, int) {} - -namespace testing { -namespace internal { -class IgnoredValue { - public: - template <typename T> - IgnoredValue(const T& /* ignored */) {} -}; -} -typedef internal::IgnoredValue Unused; -} - -using ::testing::Unused; - -void MockFunction(Unused, int q, Unused) { - ++q; - ++q; - ++q; -} - -namespace std { -typedef decltype(nullptr) nullptr_t; -} - -void f(std::nullptr_t) {} |