Wizard created this revision.
Herald added a subscriber: cfe-commits.
Wizard edited the summary of this revision.
Wizard added reviewers: benhamilton, hokein.
Now we can support property names like "hasADog" correctly.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D48039
Files:
clang-tidy/objc/PropertyDeclarationCheck.cpp
test/clang-tidy/objc-property-declaration.m
Index: test/clang-tidy/objc-property-declaration.m
===================================================================
--- test/clang-tidy/objc-property-declaration.m
+++ test/clang-tidy/objc-property-declaration.m
@@ -22,6 +22,7 @@
@property(assign, nonatomic) int shouldUseCFPreferences;
@property(assign, nonatomic) int enableGLAcceleration;
@property(assign, nonatomic) int ID;
+@property(assign, nonatomic) int hasADog;
@end
@interface Foo (Bar)
Index: clang-tidy/objc/PropertyDeclarationCheck.cpp
===================================================================
--- clang-tidy/objc/PropertyDeclarationCheck.cpp
+++ clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -45,6 +45,7 @@
"AR",
"ARGB",
"ASCII",
+ "AV",
"BGRA",
"CA",
"CF",
@@ -153,7 +154,7 @@
std::string StartMatcher = UsedInMatcher ? "::" : "^";
std::string AcronymsMatcher = AcronymsGroupRegex(EscapedAcronyms);
return StartMatcher + "(" + AcronymsMatcher + "[A-Z]?)?[a-z]+[a-z0-9]*(" +
- AcronymsMatcher + "|([A-Z][a-z0-9]+))*$";
+ AcronymsMatcher + "|([A-Z][a-z0-9]+)|A|I)*$";
}
bool hasCategoryPropertyPrefix(llvm::StringRef PropertyName) {
Index: test/clang-tidy/objc-property-declaration.m
===================================================================
--- test/clang-tidy/objc-property-declaration.m
+++ test/clang-tidy/objc-property-declaration.m
@@ -22,6 +22,7 @@
@property(assign, nonatomic) int shouldUseCFPreferences;
@property(assign, nonatomic) int enableGLAcceleration;
@property(assign, nonatomic) int ID;
+@property(assign, nonatomic) int hasADog;
@end
@interface Foo (Bar)
Index: clang-tidy/objc/PropertyDeclarationCheck.cpp
===================================================================
--- clang-tidy/objc/PropertyDeclarationCheck.cpp
+++ clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -45,6 +45,7 @@
"AR",
"ARGB",
"ASCII",
+ "AV",
"BGRA",
"CA",
"CF",
@@ -153,7 +154,7 @@
std::string StartMatcher = UsedInMatcher ? "::" : "^";
std::string AcronymsMatcher = AcronymsGroupRegex(EscapedAcronyms);
return StartMatcher + "(" + AcronymsMatcher + "[A-Z]?)?[a-z]+[a-z0-9]*(" +
- AcronymsMatcher + "|([A-Z][a-z0-9]+))*$";
+ AcronymsMatcher + "|([A-Z][a-z0-9]+)|A|I)*$";
}
bool hasCategoryPropertyPrefix(llvm::StringRef PropertyName) {
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits