This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH to prepare_eh_type for c++/15745


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) {}
+ }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]