ExprResult RebuildObjCMessageExpr(SourceLocation SuperLoc,
Selector Sel,
ArrayRef<SourceLocation> SelectorLocs,
+ QualType SuperType,
ObjCMethodDecl *Method,
SourceLocation LBracLoc,
MultiExprArg Args,
SourceLocation RBracLoc) {
- ObjCInterfaceDecl *Class = Method->getClassInterface();
- QualType ReceiverTy = SemaRef.Context.getObjCInterfaceType(Class);
-
return Method->isInstanceMethod() ? SemaRef.BuildInstanceMessage(nullptr,
- ReceiverTy,
+ SuperType,
SuperLoc,
Sel, Method, LBracLoc, SelectorLocs,
RBracLoc, Args)
: SemaRef.BuildClassMessage(nullptr,
- ReceiverTy,
+ SuperType,
SuperLoc,
Sel, Method, LBracLoc, SelectorLocs,
RBracLoc, Args);
return getDerived().RebuildObjCMessageExpr(E->getSuperLoc(),
E->getSelector(),
SelLocs,
+ E->getReceiverType(),
E->getMethodDecl(),
E->getLeftLoc(),
Args,
// RUN: %clang_cc1 %s -verify -fsyntax-only
-@interface B
+@protocol P
+-(id)description;
+@end
+
+@interface B<P>
@property int x;
@end
-@interface S : B
+@interface S : B {
+ id _someivar; // expected-note {{here}}
+}
@end
// Spell-checking 'undefined' is ok.
typedef int super1;
@implementation S
--(void)foo {
+-(void)foo:(id)p1 other:(id)p2 {
// Spell-checking 'super' is not ok.
super.x = 0;
self.x = 0;
}
+
+-(void)test {
+ [self foo:[super description] other:someivar]; // expected-error {{use of undeclared identifier 'someivar'; did you mean '_someivar'?}}
+}
@end