<div dir="ltr">On 24 January 2013 04:33, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<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 class="im"><br>
On Jan 23, 2013, at 14:53 , Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:<br>
<br>
> On Thu, Jan 24, 2013 at 12:40 AM, Alexander Zinenko <<a href="mailto:ftynse@gmail.com">ftynse@gmail.com</a>> wrote:<br>
>> On 23 January 2013 23:52, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:<br>
>>> I think it is sensible to leave the warning on by default.  The<br>
>>> purpose of a separate flag is to turn off the (possibly) noisy case<br>
>>> separately.<br>
>><br>
>> Having it on by default, clang fails to pass these tests:<br>
>>    Clang :: Analysis/inlining/dyn-dispatch-bifurcate.cpp<br>
>>    Clang :: SemaCXX/address-space-conversion.cpp<br>
>> That's why the noisy version was disabled by default even in the first<br>
>> version.<br>
><br>
> Well, compiler tests do weird things, so this is not representative.<br>
<br>
</div>dyn-dispatch-bifurcate is actually what encouraged me to file that PR in the first place. You can go ahead and add it as an expected warning there. </blockquote><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">


<br>
For address-space-conversion, you could disable the warning in the RUN line.<br></blockquote><div> </div><div style>Thanks, I was not sure changing anyone else's test is OK.  Updated patch modifies these tests.</div>

<div><br></div><div><span style="color:rgb(80,0,80)">On Jan 23, 2013, at 14:53 , Dmitri Gribenko <</span><a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a><span style="color:rgb(80,0,80)">> wrote:</span> </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 class=""><div class="h5">> I think the only reasonable false positive source for zero adjustment<br>


> case is templates:<br>
><br>
> template<typename T, typename U><br>
> void foo(T *t) {<br>
>  ... reinterpret_cast<U*>(t);<br>
> }<br>
><br>
> Where T and U have some subtyping relationship.<br></div></div></blockquote><div><br></div><div style>Warning could be disabled for dependent types. </div><div style>Trivial case warning adds an extra note where the template was instantiated, though. As for me it's worth still having it enabled.</div>

<div> </div><div>template.cpp:15:10: warning: 'reinterpret_cast' is used as an upcast from type 'B *' to its base type 'A *' [-Wreinterpret-updown-zero-adjustment]</div><div>  (void)*reinterpret_cast<U *>(t);</div>

<div>         ^~~~~~~~~~~~~~~~~~~~~~~~</div><div>template.cpp:20:3: note: in instantiation of function template specialization 'foo<B, A>' requested here</div><div>  foo<B, A>(&b);</div><div> </div>

</div><br></div></div>