[PATCH] D55482: [clang-tidy] Improve google-objc-function-naming diagnostics 📙
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 11 10:37:34 PST 2018
aaron.ballman added inline comments.
================
Comment at: clang-tidy/google/FunctionNamingCheck.cpp:113
+ const bool IsGlobal = MatchedDecl->getStorageClass() != SC_Static;
diag(MatchedDecl->getLocation(),
----------------
Drop the top-level `const` qualifier, please.
================
Comment at: clang-tidy/google/FunctionNamingCheck.cpp:115
diag(MatchedDecl->getLocation(),
- "function name %0 not using function naming conventions described by "
- "Google Objective-C style guide")
- << MatchedDecl << generateFixItHint(MatchedDecl);
+ "%select{static|global}1 function name %0 must %select{be in|have an "
+ "appropriate prefix followed by}1 Pascal case as required by Google "
----------------
stephanemoore wrote:
> benhamilton wrote:
> > I know "global" is the correct name, but I feel like "non-static" might be clearer to folks dealing with these error messages.
> >
> > WDYT?
> >
> I'm wary of saying "non-static" because namespaced functions in Objective-C++ are not subject to the cited rules. The term "non-static" seems like it could be interpreted to extend to namespaced functions which could potentially mislead someone into adding prefixes to namespaced functions in Objective-C++.
How about "%select{static function|function in global namespace}1 named %0..."
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55482/new/
https://reviews.llvm.org/D55482
More information about the cfe-commits
mailing list