From a6f039e2e8258ba1d4421d0995d20554e70ebbdf Mon Sep 17 00:00:00 2001 From: Stephane Moore Date: Tue, 4 Dec 2018 23:40:42 +0000 Subject: =?UTF-8?q?[clang-tidy]=20Ignore=20namespaced=20and=20C++=20member?= =?UTF-8?q?=20functions=20in=20google-objc-function-naming=20check=20?= =?UTF-8?q?=F0=9F=99=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: The google-objc-function-naming check applies to functions that are not namespaced and should not be applied to C++ member functions. Such function declarations should be ignored by the check to avoid false positives in Objective-C++ sources. Reviewers: benhamilton, aaron.ballman Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D55101 --- .../test/clang-tidy/google-objc-function-naming.mm | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 clang-tools-extra/test/clang-tidy/google-objc-function-naming.mm (limited to 'clang-tools-extra/test') diff --git a/clang-tools-extra/test/clang-tidy/google-objc-function-naming.mm b/clang-tools-extra/test/clang-tidy/google-objc-function-naming.mm new file mode 100644 index 00000000000..2e894575528 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/google-objc-function-naming.mm @@ -0,0 +1,30 @@ +// RUN: %check_clang_tidy %s google-objc-function-naming %t + +void printSomething() {} +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function name 'printSomething' not +// using function naming conventions described by Google Objective-C style guide + +void PrintSomething() {} +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function name 'PrintSomething' not +// using function naming conventions described by Google Objective-C style guide + +void ABCBad_Name() {} +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function name 'ABCBad_Name' not +// using function naming conventions described by Google Objective-C style guide + +namespace { + +int foo() { return 0; } + +} + +namespace bar { + +int convert() { return 0; } + +} + +class Baz { +public: + int value() { return 0; } +}; -- cgit v1.2.3