summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp
index d460c6bbd5f..b772a5e6a0a 100644
--- a/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp
+++ b/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -201,8 +201,7 @@ PropertyDeclarationCheck::PropertyDeclarationCheck(StringRef Name,
void PropertyDeclarationCheck::registerMatchers(MatchFinder *Finder) {
// this check should only be applied to ObjC sources.
- if (!getLangOpts().ObjC)
- return;
+ if (!getLangOpts().ObjC) return;
if (IncludeDefaultAcronyms) {
EscapedAcronyms.reserve(llvm::array_lengthof(DefaultSpecialAcronyms) +
@@ -235,9 +234,9 @@ void PropertyDeclarationCheck::check(const MatchFinder::MatchResult &Result) {
auto *DeclContext = MatchedDecl->getDeclContext();
auto *CategoryDecl = llvm::dyn_cast<ObjCCategoryDecl>(DeclContext);
- auto AcronymsRegex =
- llvm::Regex("^" + AcronymsGroupRegex(EscapedAcronyms) + "$");
- if (AcronymsRegex.match(MatchedDecl->getName())) {
+ auto SingleAcronymRegex =
+ llvm::Regex("^([a-zA-Z]+_)?" + AcronymsGroupRegex(EscapedAcronyms) + "$");
+ if (SingleAcronymRegex.match(MatchedDecl->getName())) {
return;
}
if (CategoryDecl != nullptr &&
OpenPOWER on IntegriCloud