Summary: using ivar in class extension is not supported in 32-bit architecture of MacOS.
Reviewers: alexfh, hokein
Reviewed By: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D45912
llvm-svn: 330559
m(TemplateParameter) \
m(TypeAlias) \
m(MacroDefinition) \
+ m(ObjcIvar) \
enum StyleKind {
#define ENUMERATE(v) SK_ ## v,
const NamedDecl *D,
const std::vector<llvm::Optional<IdentifierNamingCheck::NamingStyle>>
&NamingStyles) {
+ if (isa<ObjCIvarDecl>(D) && NamingStyles[SK_ObjcIvar])
+ return SK_ObjcIvar;
+
if (isa<TypedefDecl>(D) && NamingStyles[SK_Typedef])
return SK_Typedef;
--- /dev/null
+// RUN: %check_clang_tidy %s readability-identifier-naming %t \
+// RUN: -config='{CheckOptions: \
+// RUN: [{key: readability-identifier-naming.ObjcIvarPrefix, value: '_'}]}' \
+// RUN: --
+
+@interface Foo
+@end
+
+@implementation Foo {
+ int _bar;
+ int barWithoutPrefix;
+ // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for objc ivar 'barWithoutPrefix' [readability-identifier-naming]
+ // CHECK-FIXES: int _barWithoutPrefix;
+}
+@end