diff options
author | Stephane Moore <mog@google.com> | 2019-02-02 23:01:20 +0000 |
---|---|---|
committer | Stephane Moore <mog@google.com> | 2019-02-02 23:01:20 +0000 |
commit | 07599ccf0c97fd013b07981363eb7db2d6f6d13f (patch) | |
tree | c2ebb8ed24ee7cc65bfd05e968dc20947e435116 | |
parent | 9db0915c116e1301b04849416c1c9008dface6f9 (diff) | |
download | clang-tools-extra-07599ccf0c97fd013b07981363eb7db2d6f6d13f.tar.gz |
Revert rCTE352968 due to compilation failures 💥
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352969 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | clang-tidy/google/FunctionNamingCheck.cpp | 10 | ||||
-rw-r--r-- | test/clang-tidy/google-objc-function-naming.m | 8 |
2 files changed, 3 insertions, 15 deletions
diff --git a/clang-tidy/google/FunctionNamingCheck.cpp b/clang-tidy/google/FunctionNamingCheck.cpp index 8096d65d..3eeb6fa6 100644 --- a/clang-tidy/google/FunctionNamingCheck.cpp +++ b/clang-tidy/google/FunctionNamingCheck.cpp @@ -93,16 +93,12 @@ void FunctionNamingCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().ObjC) return; - // Enforce Objective-C function naming conventions on all functions except: - // • Functions defined in system headers. - // • C++ member functions. - // • Namespaced functions. - // • Implicitly defined functions. - // • The main function. + // Match function declarations that are not in system headers and are not + // main. Finder->addMatcher( functionDecl( unless(anyOf(isExpansionInSystemHeader(), cxxMethodDecl(), - hasAncestor(namespaceDecl()), isMain(), isImplicit(), + hasAncestor(namespaceDecl()), isMain(), matchesName(validFunctionNameRegex(true)), allOf(isStaticStorageClass(), matchesName(validFunctionNameRegex(false)))))) diff --git a/test/clang-tidy/google-objc-function-naming.m b/test/clang-tidy/google-objc-function-naming.m index 82169cf9..d0336d26 100644 --- a/test/clang-tidy/google-objc-function-naming.m +++ b/test/clang-tidy/google-objc-function-naming.m @@ -1,13 +1,5 @@ // RUN: %check_clang_tidy %s google-objc-function-naming %t -#import <stdio.h> - -static void TestImplicitFunctionDeclaration(int a) { - // Call a builtin function so that the compiler generates an implicit - // function declaration. - printf("%d", a); -} - typedef _Bool bool; static bool ispositive(int a) { return a > 0; } |