Skip to content

Commit 60d73cc

Browse files
committed
[WIP] Avoid invalidating @_objcImplementation
rdar://134730183
1 parent 96b14a7 commit 60d73cc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/Sema/TypeCheckDeclObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void ObjCReason::describe(const Decl *D) const {
153153
}
154154

155155
void ObjCReason::setAttrInvalid() const {
156-
if (requiresAttr(kind))
156+
if (shouldInvalidateAttr(kind))
157157
getAttr()->setInvalid();
158158
}
159159

lib/Sema/TypeCheckObjC.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ class ObjCReason {
127127
}
128128
}
129129

130+
/// If the declaration cannot be made \c @objc , should we invalidate the
131+
/// attribute?
132+
static bool shouldInvalidateAttr(Kind kind) {
133+
if (kind == MemberOfObjCImplementationExtension)
134+
return false;
135+
return requiresAttr(kind);
136+
}
137+
130138
public:
131139
/// Implicit conversion from the trivial reason kinds.
132140
ObjCReason(Kind kind) : kind(kind) {

0 commit comments

Comments
 (0)