<div dir="ltr">Thanks for the review (and catching the fail on my part)!<div><br></div><div>MSVC accepts your templated example without complaint. The patched clang asserts in EvalAddr() in SemaChecking.cpp after being called by Sema::CheckReturnStackAddr() with "EvalAddr only works on pointers" using your example case.</div>
<div><br></div><div>Do you have some ideas on how best to support this facet of MSVC behavior without uglifying the code too much?</div><div><br></div><div>Thanks,</div><div>Will.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 27 August 2013 22:04, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Please use isCXX98IntegralConstantExpr, not isIntegerConstantExpr, in C++11 + MicrosoftMode. (Take a look at how we behaved prior to r183883.) We *really* don't want to use full constexpr evaluation when determining whether an expression is a null pointer constant.<div>
<br></div><div>Also, this patch tries to evaluate value-dependent potential null pointer constants in C++11 + MicrosoftMode. That's not OK, and will sometimes assert. How should we behave here? Does MSVC accept this:</div>
<div><br></div><div>template<int N> int *f() { return N; }</div><div>int *p = f<0>();</div><div><br></div><div>?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Aug 27, 2013 at 10:05 AM, Will Wilson <span dir="ltr"><<a href="mailto:will@indefiant.com" target="_blank">will@indefiant.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi All,<div><br></div><div>This patch uses the more relaxed integer expression codepath in Expr::isNullPointerConstant() when MicrosoftMode is enabled, this reflects MSVC behavior and is required to compile various cases I've come across in MSVC targeted code.</div>
<div><br></div><div>Test case included. Built and tested against latest code. Please review and commit if possible.</div><div><br></div><div>Thanks!</div><span><font color="#888888"><div>Will.</div><div><div>
<br></div>-- <br><div dir="ltr"><div><span style="color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif"><b>Indefiant Ltd.</b></span></div>
</div>
</div></font></span></div>
<br></div></div>_______________________________________________<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>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><span style="background-color:rgb(255,255,255);color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif"><b>Indefiant Ltd.</b></span></div>
</div>
</div>