<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Il giorno 25/ott/2011, alle ore 11:59, Abramo Bagnara ha scritto:</div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>This should be considered with some attention:<br><br>void f(int (&x)[]);<br>void f(int *x);<br>void g(int *x);<br><br>void t() {<br>  int a[4];<br>  f((int*)a);<br>  f(a);<br>  g((int*)a);<br>  g(a);<br>}<br><br>In first call to f and g I think that the ArrayToPointer should be<br>considered explicit.<br><br></div></blockquote><div><br></div><div>From a source-centric point of view, maybe yes. However,</div><div>as far as I know, an array type always immediately decays</div><div>when used, in cases other than the argument of a sizeof()</div><div>operator and a few others.</div><div>If so, 'a' has already decayed to int * before the cast,</div><div>so the cast is NoOp because it's actually useless.</div><div><br></div><div>But I'm certainly not a language lawyer…</div><div><br></div><div>Anyway, if we want to make those cases explicit,</div><div>it looks like a bit more complex than other cases, because</div><div>simply changing those cases to use CastExprToType</div><div>doesn't seem to work out-of-the-box, and I need to</div><div>figure out what is happening.</div><div><br></div><div><br></div><div>Nicola</div><br></div><div><br></div></body></html>