<div dir="ltr">It's not decaying VLAs; it's making sure that VLA array bound expressions don't leak outside the parameter declaration.<div><br></div><div>(Arguably, they shouldn't be part of the type returned by ParmVarDecl::getType(), but that's a different discussion.)</div>
<div><br></div><div>-Eli</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 11, 2013 at 12:39 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</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">Both ParmVarDecl and FunctionDecl::getType() are staying the same.  However, most other FunctionProtoType Exprs in the AST now have undecayed types, and we can make calls with them.  This is because there are many calls to GetTypeForDeclarator() that could return a FunctionProtoType, and it didn't seem right to check all of them.<div>

<br></div><div>Why would you say it's wrong to decay variable length arrays in InitializeParameter(), but not normal arrays?</div><div><br></div><div>If it is wrong, I think most instances could be fixed by adjusting the type in GatherArgumentsForCall.</div>

</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 11, 2013 at 3:16 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</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">Err, wait, that's not right; I'm pretty sure you aren't changing the return type of <span style="font-family:arial,sans-serif;font-size:13px">ParmVarDecl::getType() (correct me if I'm wrong).  In that case, you shouldn't be changing InitializedEntity::</span>InitializeParameter, but rather its caller.<span><font color="#888888"><div>


<br></div><div>-Eli</div></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 11, 2013 at 12:13 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</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">Sorry I didn't catch this the first time around, but why are you changing the return value of ParmVarDecl::getType()?  ParmVarDecl::getOriginalType() already returns the type before adjustment.<br>


<div><br>
</div><div>-Eli</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Tue, Jun 11, 2013 at 12:02 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br>




</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>This was originaly r183614 which was reverted in r183616.<br>




<br>
The fix here was to change InitializeParameter() to use<br>
ASTContext::getSignatureParameterType() to avoid errors when trying to<br>
initialize array parameters with normal pointers.<br>
<br>
I had to change some objc tests which were getting extra qualifiers in<br>
diagnostics, but they looked coincidental, not intentional.<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D957" target="_blank">http://llvm-reviews.chandlerc.com/D957</a><br>
<br>
Files:<br>
  include/clang/Sema/Initialization.h<br>
  lib/Sema/SemaDecl.cpp<br>
  lib/Sema/SemaType.cpp<br>
  test/Index/print-type.c<br>
  test/Index/print-type.cpp<br>
  test/Sema/function-redecl.c<br>
  test/Sema/function.c<br>
  test/SemaObjC/objc-literal-nsnumber.m<br>
  test/SemaObjCXX/<a href="http://arc-type-conversion.mm" target="_blank">arc-type-conversion.mm</a><br>
  test/SemaObjCXX/<a href="http://literals.mm" target="_blank">literals.mm</a><br>
<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></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>