<div dir="ltr">Hi Rahul,<div><br></div><div> Does your patch fix the other two examples given in PR14995? Perhaps they should also be added as regression tests.</div><div>(Just from eyeballing the code, I think your patch *does* fix them, including my example where the T is dependent on a class template instead of on a function template; but it might be nice to test explicitly.)</div>
<div><br></div><div>LGTM.</div><div><br></div><div>–Arthur</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 30, 2014 at 6:55 AM, Rahul Jain <span dir="ltr"><<a href="mailto:rahul1.jain@samsung.com" target="_blank">rahul1.jain@samsung.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<p> </p>
<p>Hi,</p>
<p>This patch fixes PR14995 - <span><span>Too eagerly rejects operator function templates.</span></span></p>
<p><span><span>Please help review the same.</span></span></p>
<p><span><span></span></span> </p>
<p><span><span>Index: lib/Sema/SemaDeclCXX.cpp<br>===================================================================<br>--- lib/Sema/SemaDeclCXX.cpp (revision 200465)<br>+++ lib/Sema/SemaDeclCXX.cpp (working copy)<br>@@ -10913,7 +10913,11 @@<br>
if (const BuiltinType *BT = LastParam->getType()->getAs<BuiltinType>())<br> ParamIsInt = BT->getKind() == BuiltinType::Int;<br> <br>- if (!ParamIsInt)<br>+ bool ParamIsDependent = false;<br>
+ if (LastParam->getType()->isDependentType())<br>+ ParamIsDependent = true;<br>+<br>+ if (!ParamIsInt && !ParamIsDependent)<br> return Diag(LastParam->getLocation(),<br> diag::err_operator_overload_post_incdec_must_be_int)<br>
<< LastParam->getType() << (Op == OO_MinusMinus);<br>Index: test/SemaCXX/overloaded-operator.cpp<br>===================================================================<br>--- test/SemaCXX/overloaded-operator.cpp (revision 200465)<br>
+++ test/SemaCXX/overloaded-operator.cpp (working copy)<br>@@ -452,3 +452,16 @@<br> Result = 1; // expected-error {{no viable overloaded '='}} // expected-note {{type 'PointerUnion<int *, float *>' is incomplete}}<br>
}<br> }<br>+<br>+namespace PR14995 {<br>+<br>+ struct B {};<br>+ template<typename ...T> void operator++(B, T...) {}<br>+<br>+ void f() {<br>+ B b;<br>+ b++; // ok<br>+ ++b; // ok<br>+ }<br>+}<br>+</span></span></p>
<p><span><span></span></span> </p>
<p><span><span></span></span> </p>
<p><span><span>Thanks,</span></span></p>
<p><span><span>Rahul</span></span></p>
<p> </p>
<table>
<tbody>
<tr>
<td>
<p><img border="0" src="cid:XOK0LK7CT9SZ@namo.co.kr" width="520"></p></td></tr></tbody></table></div><img src="http://ext.samsung.net/mailcheck/SeenTimeChecker?do=d39c7ebe3c5c4be3b749e4adb16ef39adfe1b2c7effbe582e56225dd835e375f5f887f84397989de4b5562a776ba3bf30029dc535ebebcd3326bbdfb2ea96a2fcf878f9a26ce15a0" border="0" width="0" height="0"><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">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>
<br></blockquote></div><br></div>