This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to prepare_eh_type for c++/15745
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 05 Sep 2007 23:33:21 -0400
- Subject: Re: C++ PATCH to prepare_eh_type for c++/15745
- References: <46DF74E5.1070203@redhat.com>
Whoops, forgot the patch:
2007-09-05 Jason Merrill <jason@redhat.com>
PR c++/15745
* except.c (prepare_eh_type): Use type_decays_to.
Index: cp/except.c
===================================================================
*** cp/except.c (revision 128173)
--- cp/except.c (working copy)
*************** prepare_eh_type (tree type)
*** 115,120 ****
--- 115,123 ----
/* Peel off cv qualifiers. */
type = TYPE_MAIN_VARIANT (type);
+ /* Functions and arrays decay to pointers. */
+ type = type_decays_to (type);
+
return type;
}
Index: testsuite/g++.dg/ext/vla4.C
===================================================================
*** testsuite/g++.dg/ext/vla4.C (revision 128173)
--- testsuite/g++.dg/ext/vla4.C (working copy)
*************** void f(int i) {
*** 7,13 ****
try {
int a[i];
throw &a; // { dg-error "variable size" }
! } catch (int (&)[i]) { // { dg-error "variable size" }
}
}
--- 7,13 ----
try {
int a[i];
throw &a; // { dg-error "variable size" }
! } catch (int (*)[i]) { // { dg-error "variable size" }
}
}
Index: testsuite/g++.dg/eh/spec9.C
===================================================================
*** testsuite/g++.dg/eh/spec9.C (revision 0)
--- testsuite/g++.dg/eh/spec9.C (revision 0)
***************
*** 0 ****
--- 1,19 ----
+ // PR c++/15745
+ // { dg-do run }
+
+ typedef int IntArray[10];
+ IntArray i;
+
+ void test_array() throw (IntArray)
+ {
+ throw i;
+ }
+
+ int main ()
+ {
+ try
+ {
+ test_array();
+ }
+ catch (IntArray) {}
+ }