<div class="gmail_quote">On Thu, Jun 17, 2010 at 3:13 PM, Fariborz Jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On Jun 17, 2010, at 2:56 PM, Nico Weber wrote:</div><br><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br> <br> @interface NSObject {}<br> -- (void)respondsToSelector:(SEL&)s : (SEL*)s1;<br> +- (void)respondsToSelector:(const SEL&)s : (SEL*)s1;<br></blockquote><div><br></div><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse"><div>
Shouldn't non-const SEL references still work?</div></span></div></div></blockquote></div>Message would be:</div><div><div>t.mm:11:30: error: non-const lvalue reference to type 'SEL' cannot bind to a temporary of type 'SEL'</div>
<div> [self respondsToSelector:@selector(setPriority:)];</div><div> ^~~~~~~~~~~~~~~~~~~~~~~</div></div></div></blockquote><div><br></div><div>Oh, sorry, didn't look at the calling site.</div>
<div><br></div><div> SEL a;</div><div> [self respondsToSelector:a];</div><div> </div><div>should still work though :-)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div><br></div><div>It is not an lvalue, it cannot be passed by reference. </div><div>Message is coming out of c++ side. Presumably no different that:</div><div><div>void foo(int&);</div>
<div>int main()</div><div>{</div><div> foo(10);</div><div>}</div><div><br></div></div><font color="#888888"><div><br></div><div>- Fariborz</div></font><div class="im"><div><br></div><div><br></div><blockquote type="cite">
<div class="gmail_quote"><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse"> <div style="color:rgb(80, 0, 80)"></div></span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- (void) setPriority:(int)p;<br> - (void)Meth;<br> @end<br> @@ -12,5 +12,5 @@<br> [self respondsToSelector:@selector(setPriority:) : &@selector(setPriority:)];<br> }<br> - (void) setPriority:(int)p{}<br> -- (void)respondsToSelector:(SEL&)s : (SEL*)s1 {}<br>
+- (void)respondsToSelector:(const SEL&)s : (SEL*)s1 {}<br> @end<br> <br> <br> _______________________________________________<br> cfe-commits mailing list<br> <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br> </blockquote></div><br></blockquote></div></div><br></div></blockquote></div><br>