<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Reid Kleckner [mailto:rnk@google.com]
<br>
<b>Sent:</b> Tuesday, May 2, 2017 1:17 PM<br>
<b>To:</b> Keane, Erich <erich.keane@intel.com><br>
<b>Cc:</b> cfe-dev@lists.llvm.org; cfe-dev-request@lists.llvm.org; chenwj.cs97g@g2.nctu.edu.tw; mats@planetcatfish.com<br>
<b>Subject:</b> Re: [cfe-dev] Strange return value of Sema::CheckFunctionReturnType<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">If this check can never fail and is cheap, we should just strengthen it to an assertion to check that <span style="font-size:9.5pt">GetFullTypeForDeclarator diagnoses this for us.<o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">[Keane, Erich] Actually, I stand corrected…. There IS a case in our tests where it would hit such an assertion, though it didn’t hit my breakpoint when
debugging. I’ve never debugged ObjC before, so I must have just messed that up.<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">That said, it IS hit in an existing test, though I’m not sure why the ‘return 0’ never caused an issue in the test. I’ll note that it is also missing its
FixItHint, which would likely have benefit to add. I’ll toss a review on phabricator in a little bit that I’ll send to you all to take a look at.</span></i></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Tue, May 2, 2017 at 10:03 AM, Keane, Erich via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal">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: <span style="font-family:"Calibri",sans-serif">陳韋任</span> <<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">qLeTMeK3wg9XHMoFN+NTSvEwc+Nu-_psUg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
On 2 May 2017 at 16:08, <span style="font-family:"Calibri",sans-serif">陳韋任</span> <<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 (<span style="font-family:"Calibri",sans-serif">陳韋任</span>)<br>
> Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a><br>
><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">_______________________________________________<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" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>