summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
diff options
context:
space:
mode:
authorStephane Moore <mog@google.com>2018-12-04 23:40:42 +0000
committerStephane Moore <mog@google.com>2018-12-04 23:40:42 +0000
commitf6d96e0f985cc1f69aeb8dfbf962e75e711fb163 (patch)
tree74ce0b1e7a81f5871d82281d9a557d83f62d29bb /clang-tools-extra/clang-tidy
parentd6bab09b4b6e81565167d83ed16e91cb65f1bfb7 (diff)
downloadbcm5719-llvm-f6d96e0f985cc1f69aeb8dfbf962e75e711fb163.tar.gz
bcm5719-llvm-f6d96e0f985cc1f69aeb8dfbf962e75e711fb163.zip
[clang-tidy] Ignore namespaced and C++ member functions in google-objc-function-naming check 🙈
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 llvm-svn: 348317
Diffstat (limited to 'clang-tools-extra/clang-tidy')
-rw-r--r--clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp b/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp
index 7aeadd38c02..6d07472ef54 100644
--- a/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp
@@ -98,8 +98,9 @@ void FunctionNamingCheck::registerMatchers(MatchFinder *Finder) {
// main.
Finder->addMatcher(
functionDecl(
- unless(isExpansionInSystemHeader()),
- unless(anyOf(isMain(), matchesName(validFunctionNameRegex(true)),
+ unless(anyOf(isExpansionInSystemHeader(), cxxMethodDecl(),
+ hasAncestor(namespaceDecl()), isMain(),
+ matchesName(validFunctionNameRegex(true)),
allOf(isStaticStorageClass(),
matchesName(validFunctionNameRegex(false))))))
.bind("function"),
OpenPOWER on IntegriCloud