Hi Richard,<div><br></div><div>You're right. I've revised the patch.</div><div>Patch url: <a href="http://llvm.org/bugs/attachment.cgi?id=9583">http://llvm.org/bugs/attachment.cgi?id=9583</a></div><div>(Sorry that my environment cannot upload it to GMail)</div>
<div><br>I didn't put the logic inside CheckSpecifiedExceptionType, since the QualType is pass-by-value, instead, I found I should put it before it.</div><div>I also made a test case.</div><div><br></div><div>Please help review it.</div>
<div>Thanks!</div><div><br><div class="gmail_quote">2012/11/21 Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, Nov 20, 2012 at 7:20 PM, WenHan Gu (¨¦¨Z¿«) <<a href="mailto:wenhan.gu@gmail.com">wenhan.gu@gmail.com</a>> wrote:<br>
> Hi Richard,<br>
> Thanks your comments.<br>
><br>
> However, I have no idea whether I should do this patch.<br>
> I've tested by gcc, clang and searched C++ spec draft n3242, the result is<br>
> that both GCC and Clang failed on that and I cannot find any wording on this<br>
> issue.<br>
<br>
</div>I suggest you switch to using n3485.<br>
<br>
15.4/2:<br>
<br>
A type denoted in an exception-specification shall not denote an<br>
incomplete type other than a class<br>
currently being defined or an rvalue reference type. A type denoted in<br>
an exception-specification shall not<br>
denote a pointer or reference to an incomplete type, other than cv<br>
void* or a pointer or reference to a<br>
class currently being defined. A type cv T, “array of T”, or “function<br>
returning T” denoted in an exception-<br>
specification is adjusted to type T, “pointer to T”, or “pointer to<br>
function returning T”, respectively.<br>
<br>
We are supposed to apply the decay from S[10] to S* before we check<br>
whether it's an incomplete-or-being-defined type or a pointer to an<br>
incomplete-or-being-defined type, so S[10] is OK.<br>
<div class="HOEnZb"><div class="h5"><br>
> Could you teach me more or could some else help?<br>
> Thanks!<br>
><br>
>   1 struct S {<br>
>   2   void foo() throw (S[10])  { throw 0; }  // Both gcc and clang failed<br>
> on this function<br>
>   3   void bar() throw (S)  { throw 0; }<br>
>   4 };<br>
>   5<br>
>   6 int main() {<br>
>   7   S().foo();<br>
>   8   S().bar();<br>
>   9 }<br>
><br>
><br>
><br>
><br>
> 2012/11/21 Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>><br>
>><br>
>> Hi,<br>
>><br>
>> On Tue, Nov 20, 2012 at 1:54 AM, WenHan Gu (¨¦¨Z¿«) <<a href="mailto:wenhan.gu@gmail.com">wenhan.gu@gmail.com</a>><br>
>> wrote:<br>
>> > Hi all,<br>
>> ><br>
>> > I've done the patch and testcase to fix PR14338.<br>
>> > <a href="http://llvm.org/bugs/show_bug.cgi?id=14388" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=14388</a><br>
>> ><br>
>> > Here's the patch, please review:<br>
>> > <a href="http://llvm.org/bugs/attachment.cgi?id=9574&action=diff" target="_blank">http://llvm.org/bugs/attachment.cgi?id=9574&action=diff</a><br>
>> ><br>
>> ><br>
>> > Is that okay to commit?<br>
>><br>
>> A matching update is needed in SemaTemplateInstantiateDecl. Perhaps<br>
>> you could put this logic into CheckSepcifiedExceptionType (and either<br>
>> return the modified type or pass it through by reference)? One of the<br>
>> checks in  CheckSpecifiedExceptionType also needs updating. With your<br>
>> patch, we still reject this:<br>
>><br>
>> struct S {<br>
>>   void f() throw (S[10]);<br>
>> };<br>
>><br>
>> ... but we should accept it, because the type 'S' is supposed to be<br>
>> considered as complete in exception specifications inside its body.<br>
><br>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Wen-Han Gu (Nowar)<br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards,<div>Wen-Han Gu (Nowar)</div><br>
</div>