On Jun 17, 2010, at 2:56 PM, Nico Weber wrote:
@interface NSObject {}
-- (void)respondsToSelector:(SEL&)s : (SEL*)s1;
+- (void)respondsToSelector:(const SEL&)s : (SEL*)s1;
Shouldn't non-const SEL references still work?
Message would be:
t.mm:11:30: error: non-const lvalue reference to type 'SEL' cannot
bind to a temporary of type 'SEL'
[self respondsToSelector:@selector(setPriority:)];
^~~~~~~~~~~~~~~~~~~~~~~
It is not an lvalue, it cannot be passed by reference.
Message is coming out of c++ side. Presumably no different that:
void foo(int&);
int main()
{
foo(10);
}
- Fariborz
- (void) setPriority:(int)p;
- (void)Meth;
@end
@@ -12,5 +12,5 @@
[self respondsToSelector:@selector(setPriority:) :
&@selector(setPriority:)];
}
- (void) setPriority:(int)p{}
-- (void)respondsToSelector:(SEL&)s : (SEL*)s1 {}
+- (void)respondsToSelector:(const SEL&)s : (SEL*)s1 {}
@end
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits