aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/except.c3
-rw-r--r--gcc/testsuite/g++.dg/eh/spec9.C19
-rw-r--r--gcc/testsuite/g++.dg/ext/vla4.C2
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a32ecdb..6bcc3ef 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2007-09-05 Jason Merrill <jason@redhat.com>
+ PR c++/15745
+ * except.c (prepare_eh_type): Use type_decays_to.
+
PR c++/15097
* init.c (build_delete): Use build_headof to get the address of the
complete object if we aren't using the deleting destructor.
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 199d185..38111b1 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -115,6 +115,9 @@ prepare_eh_type (tree type)
/* Peel off cv qualifiers. */
type = TYPE_MAIN_VARIANT (type);
+ /* Functions and arrays decay to pointers. */
+ type = type_decays_to (type);
+
return type;
}
diff --git a/gcc/testsuite/g++.dg/eh/spec9.C b/gcc/testsuite/g++.dg/eh/spec9.C
new file mode 100644
index 0000000..9e00d1c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/spec9.C
@@ -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) {}
+}
diff --git a/gcc/testsuite/g++.dg/ext/vla4.C b/gcc/testsuite/g++.dg/ext/vla4.C
index 8b7f38f..ecec908 100644
--- a/gcc/testsuite/g++.dg/ext/vla4.C
+++ b/gcc/testsuite/g++.dg/ext/vla4.C
@@ -7,7 +7,7 @@ void f(int i) {
try {
int a[i];
throw &a; // { dg-error "variable size" }
- } catch (int (&)[i]) { // { dg-error "variable size" }
+ } catch (int (*)[i]) { // { dg-error "variable size" }
}
}