<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 23, 2009, at 11:27 PM, Anders Carlsson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>23 nov 2009 kl. 15.44 skrev Douglas Gregor:<br><br><blockquote type="cite">Author: dgregor<br></blockquote><blockquote type="cite">Date: Mon Nov 23 17:44:04 2009<br></blockquote><blockquote type="cite">New Revision: 89717<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=89717&view=rev">http://llvm.org/viewvc/llvm-project?rev=89717&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Explicitly track the condition variable within an "if" statement,<br></blockquote><blockquote type="cite">rather than burying it in a CXXConditionDeclExpr (that occassionally<br></blockquote><blockquote type="cite">hides behind implicit conversions). Similar changes for<br></blockquote><blockquote type="cite">switch, while, and do-while will follow, then the removal of<br></blockquote><blockquote type="cite">CXXConditionDeclExpr. This commit is the canary.<br></blockquote><br>This broke the following test:<br><br>void *f();<br><br>template <typename T> T* g() {<br>  if (T* t = f())<br>    return t;<br><br>  return 0;<br>}<br><br>void h() {<br>  void *a = g<void>();<br>}<br><br>which is very common in clang (getAs<FooType>() :)<br></div></blockquote><div><br></div>Yikes! Sorry, this is fixed in <span class="Apple-style-span" style="font-family: 'Lucida Grande'; ">r89769. Test-case coming soon.</span></div><div><font class="Apple-style-span" face="'Lucida Grande'"><br></font><blockquote type="cite"><div>Also, if you're getting rid of CXXConditionDeclExpr, then how are you going to disambiguate between<br><br>if (void * f = foo()) { }<br><br>and<br><br>void *f = foo();<br><br>if (f) { }<br><br>Since both cond exprs in this case are going to be DeclRefExprs.<br></div></blockquote></div><div><br></div>The IfStmt stores its conditional variable (as a VarDecl). so we can look there. It's actually much cleaner, since today the declaration is buried within a CXXConditionDeclExpr that may have implicit conversions and temporary-destruction nodes wrapped around it.<div><br><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></div></body></html>