<div dir="ltr"><div>Looks like a bug to me. It should return `true`. I was going to say that it's a minor bug, (where `0` and `false` are possible to convert in either direction, but it's actually returning an incorrect result.<br><br></div><div>A patch to fix this, and adding a test-case would probably be appreciated.<br></div><div><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 May 2017 at 15:26, 陳韋任 via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
  While reading Sema::CheckFunctionReturnType in SemaType.cpp [1], I<br>
find something strange.<br>
>From the context, the return value of CheckFunctionReturnType indicate<br>
something is invalid.<br>
If the check fail, CheckFunctionReturnType returns true.<br>
<br>
The other two checks in CheckFunctionReturnType return true as I<br>
expected. But the following<br>
check return 0, which should be false.<br>
<br>
    if (T->isObjCObjectType()) {<br>
      Diag(Loc, diag::err_object_cannot_be_<wbr>passed_returned_by_value) << 0 << T;<br>
      return 0;<br>
    }<br>
<br>
Is it a bug? Or I am reading the code wrong?<br>
<br>
Thanks.<br>
<br>
[1] <a href="https://clang.llvm.org/doxygen/SemaType_8cpp_source.html" rel="noreferrer" target="_blank">https://clang.llvm.org/<wbr>doxygen/SemaType_8cpp_source.<wbr>html</a><br>
<br>
Regards,<br>
chenwj<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Wei-Ren Chen (陳韋任)<br>
Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" rel="noreferrer" target="_blank">https://people.cs.nctu.edu.tw/<wbr>~chenwj</a><br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div>