Wrong file, sorry.<div><a href="http://llvm.org/bugs/attachment.cgi?id=9602&action=diff">http://llvm.org/bugs/attachment.cgi?id=9602&action=diff</a></div><div><br></div><div>Thanks.</div><div><br><div class="gmail_quote">
2012/11/28 WenHan Gu (¨¦¨Z¿«) <span dir="ltr"><<a href="mailto:wenhan.gu@gmail.com" target="_blank">wenhan.gu@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Richard,<div><br></div><div>I've revised it again. I think this time all similar cases can run.</div><div>Please have a look.</div><div><a href="http://llvm.org/bugs/attachment.cgi?id=9601&action=diff" target="_blank">http://llvm.org/bugs/attachment.cgi?id=9601&action=diff</a></div>
<div>PR14388: <a href="http://llvm.org/bugs/show_bug.cgi?id=14388" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=14388</a></div><div><br></div><div>Thanks!<div><div class="h5"><br><br><div class="gmail_quote">2012/11/22 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">Hi,<br>
<div><br>
On Wed, Nov 21, 2012 at 11:58 PM, WenHan Gu (¨¦¨Z¿«) <<a href="mailto:wenhan.gu@gmail.com" target="_blank">wenhan.gu@gmail.com</a>> wrote:<br>
> Hi Richard,<br>
><br>
</div><div>> You're right. I've revised the patch.<br>
> Patch url: <a href="http://llvm.org/bugs/attachment.cgi?id=9583" target="_blank">http://llvm.org/bugs/attachment.cgi?id=9583</a><br>
> (Sorry that my environment cannot upload it to GMail)<br>
><br>
> I didn't put the logic inside CheckSpecifiedExceptionType, since the<br>
> QualType is pass-by-value, instead, I found I should put it before it.<br>
> I also made a test case.<br>
<br>
</div>This still needs changes to handle the template instantiation case<br>
(the other caller of CheckSpecifiedExceptionType):<br>
<br>
template<typename T> struct S {<br>
void f() throw(T);<br>
};<br>
S<int[10]> s;<br>
<div><div><br>
> 2012/11/21 Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>><br>
>><br>
>> On Tue, Nov 20, 2012 at 7:20 PM, WenHan Gu (¨¦¨Z¿«) <<a href="mailto:wenhan.gu@gmail.com" target="_blank">wenhan.gu@gmail.com</a>><br>
>> 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<br>
>> > is<br>
>> > that both GCC and Clang failed on that and I cannot find any wording on<br>
>> > this<br>
>> > issue.<br>
>><br>
>> 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>
>><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<br>
>> > 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" target="_blank">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" target="_blank">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>
><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></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards,<div>Wen-Han Gu (Nowar)</div><br>
</div>