[cfe-commits] [PATCH] Array exception type decay to pointer automatically

WenHan Gu (谷汶翰) wenhan.gu at gmail.com
Tue Nov 20 19:20:20 PST 2012


Hi Richard,
Thanks your comments.

However, I have no idea whether I should do this patch.
I've tested by gcc, clang and searched C++ spec draft n3242, the result is
that both GCC and Clang failed on that and I cannot find any wording on
this issue.

Could you teach me more or could some else help?
Thanks!

  1 struct S {
  2   void foo() throw (S[10])  { throw 0; }  // Both gcc and clang failed
on this function
  3   void bar() throw (S)  { throw 0; }
  4 };
  5
  6 int main() {
  7   S().foo();
  8   S().bar();
  9 }




2012/11/21 Richard Smith <richard at metafoo.co.uk>

> Hi,
>
> On Tue, Nov 20, 2012 at 1:54 AM, WenHan Gu (谷汶翰) <wenhan.gu at gmail.com>
> wrote:
> > Hi all,
> >
> > I've done the patch and testcase to fix PR14338.
> > http://llvm.org/bugs/show_bug.cgi?id=14388
> >
> > Here's the patch, please review:
> > http://llvm.org/bugs/attachment.cgi?id=9574&action=diff
> >
> >
> > Is that okay to commit?
>
> A matching update is needed in SemaTemplateInstantiateDecl. Perhaps
> you could put this logic into CheckSepcifiedExceptionType (and either
> return the modified type or pass it through by reference)? One of the
> checks in  CheckSpecifiedExceptionType also needs updating. With your
> patch, we still reject this:
>
> struct S {
>   void f() throw (S[10]);
> };
>
> ... but we should accept it, because the type 'S' is supposed to be
> considered as complete in exception specifications inside its body.
>



-- 
Best regards,
Wen-Han Gu (Nowar)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121121/f6aabaea/attachment.html>


More information about the cfe-commits mailing list