<div dir="ltr">If this check can never fail and is cheap, we should just strengthen it to an assertion to check that <span style="font-size:12.8px">GetFullTypeForDeclarator diagnoses this for us.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 2, 2017 at 10:03 AM, Keane, Erich 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">I dug through this a bit.  It is pretty clearly a bug, however I was unable to get this line to actually be hit.  It seems that GetFullTypeForDeclarator gets called before this, and fails it first.  I'm, not sure HOW we could possibly reproduce this, since there doesn't seem to be a code path that would hit this before GetFullTypeForDeclarator.<br>
<br>
Perhaps it would be valid to fix it for 'correctness' sake, and forgive its lack of test?<br>
<br>
Message: 6<br>
Date: Tue, 2 May 2017 17:27:54 +0100<br>
From: mats petersson via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
To: 陳韋任 <<a href="mailto:chenwj.cs97g@g2.nctu.edu.tw">chenwj.cs97g@g2.nctu.edu.tw</a>><br>
Cc: Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
Subject: Re: [cfe-dev] Strange return value of<br>
        Sema::CheckFunctionReturnType<br>
Message-ID:<br>
        <CAL-htr72Ry1Mg3t=<a href="mailto:qLeTMeK3wg9XHMoFN%2BNTSvEwc%2BNu-_psUg@mail.gmail.com">qLeTMeK3wg9X<wbr>HMoFN+NTSvEwc+Nu-_psUg@mail.<wbr>gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<div class="HOEnZb"><div class="h5"><br>
On 2 May 2017 at 16:08, 陳韋任 <<a href="mailto:chenwj.cs97g@g2.nctu.edu.tw">chenwj.cs97g@g2.nctu.edu.tw</a>> wrote:<br>
<br>
> 2017-05-02 22:41 GMT+08:00 mats petersson <<a href="mailto:mats@planetcatfish.com">mats@planetcatfish.com</a>>:<br>
> > Looks like a bug to me. It should return `true`. I was going to say that<br>
> > it's a minor bug, (where `0` and `false` are possible to convert in<br>
> either<br>
> > direction, but it's actually returning an incorrect result.<br>
> ><br>
> > A patch to fix this, and adding a test-case would probably be<br>
> appreciated.<br>
><br>
> Would be happy to. But I never use Objective-C, writing a test case would<br>
> be<br>
> hard to me...<br>
><br>
<br>
Neither have I, but I'm pretty sure that it can't be TERRIBLY hard...<br>
<br>
--<br>
Mats<br>
<br>
><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>
><br>
<br>
</div></div><div class="HOEnZb"><div class="h5">______________________________<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>
</div></div></blockquote></div><br></div>