Skip to content

Commit f6bf966

Browse files
authored
Revert "Check that the method ObjCMessageExpr references isn't null before passing it to diagnoseDeclFeatureAvailability"
This reverts commit 745ab81.
1 parent e8d6d9e commit f6bf966

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

clang/lib/Sema/SemaFeatureAvailability.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ class DiagnoseUnguardedFeatureAvailability
7878
}
7979

8080
bool VisitObjCMessageExpr(ObjCMessageExpr *OME) {
81-
if (auto *MD = OME->getMethodDecl())
82-
diagnoseDeclFeatureAvailability(MD, OME->getBeginLoc());
81+
diagnoseDeclFeatureAvailability(OME->getMethodDecl(), OME->getBeginLoc());
8382
return true;
8483
}
8584

clang/test/SemaObjC/feature-availability.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ @interface Derived3 : Base7<Base0 *> // expected-error {{use of 'Base0' requires
6262
@end
6363

6464
__attribute__((availability(domain:feature1, AVAIL))) // expected-note {{is incompatible with __attribute__((availability(domain:feature1, 0)))}} expected-note 2 {{feature attribute __attribute__((availability(domain:feature1, 0)))}}
65-
@interface Derived0 : Base0 { // expected-note {{receiver is instance of class declared here}}
65+
@interface Derived0 : Base0 {
6666
struct S1 *ivar4;
6767
}
6868
@property struct S1 *p0;
@@ -81,7 +81,6 @@ -(void)m0 {
8181
}
8282
-(void)m1 {
8383
self.p1 = 1;
84-
[self nonexistentMethod]; // expected-warning {{instance method '-nonexistentMethod' not found (return type defaults to 'id')}}
8584
}
8685
@end
8786

0 commit comments

Comments
 (0)