aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-01-17 07:54:36 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-01-17 07:54:36 -0500
commitad6b1795b1171d94d24abb31dfe515d311531794 (patch)
tree072dc5a084047356bdefea40c77a65bc8664e55c
parentd0e8287098058789159a24f649d61bd88a790dd4 (diff)
downloadgcc-ad6b1795b1171d94d24abb31dfe515d311531794.zip
gcc-ad6b1795b1171d94d24abb31dfe515d311531794.tar.gz
gcc-ad6b1795b1171d94d24abb31dfe515d311531794.tar.bz2
error.c (dump_type_suffix): Print the exception specs before recursing.
* error.c (dump_type_suffix): Print the exception specs before recursing. (dump_function_decl): Here, too. * cp-tree.h (TMPL_PARMS_DEPTH): Cast to signed HOST_WIDE_INT. From-SVN: r48947
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/error.c8
-rw-r--r--gcc/testsuite/g++.dg/other/error3.C5
4 files changed, 18 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3764b85..793af6d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2002-01-16 Jason Merrill <jason@redhat.com>
+
+ * error.c (dump_type_suffix): Print the exception specs before
+ recursing.
+ (dump_function_decl): Here, too.
+
+ * cp-tree.h (TMPL_PARMS_DEPTH): Cast to signed HOST_WIDE_INT.
+
2002-01-10 Ira Ruben <ira@apple.com>
* decl.c (start_method): Handle attrlist.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index c157466..88b4cdb 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2286,7 +2286,7 @@ struct lang_decl
/* The number of levels of template parameters given by NODE. */
#define TMPL_PARMS_DEPTH(NODE) \
- (TREE_INT_CST_LOW (TREE_PURPOSE (NODE)))
+ ((HOST_WIDE_INT) TREE_INT_CST_LOW (TREE_PURPOSE (NODE)))
/* The TEMPLATE_DECL instantiated or specialized by NODE. This
TEMPLATE_DECL will be the immediate parent, not the most general
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 21a171f..de62215 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -737,8 +737,8 @@ dump_type_suffix (t, flags)
if (TREE_CODE (t) == METHOD_TYPE)
dump_qualifiers
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t))), before);
- dump_type_suffix (TREE_TYPE (t), flags);
dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags);
+ dump_type_suffix (TREE_TYPE (t), flags);
break;
}
@@ -1141,15 +1141,15 @@ dump_function_decl (t, flags)
{
dump_parameters (parmtypes, flags);
- if (show_return)
- dump_type_suffix (TREE_TYPE (fntype), flags);
-
if (TREE_CODE (fntype) == METHOD_TYPE)
dump_qualifiers (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype))),
before);
if (flags & TFF_EXCEPTION_SPECIFICATION)
dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags);
+
+ if (show_return)
+ dump_type_suffix (TREE_TYPE (fntype), flags);
}
/* If T is a template instantiation, dump the parameter binding. */
diff --git a/gcc/testsuite/g++.dg/other/error3.C b/gcc/testsuite/g++.dg/other/error3.C
new file mode 100644
index 0000000..bd5d701
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/error3.C
@@ -0,0 +1,5 @@
+// Test for proper error message formatting; the throw() should go inside
+// the parens, as below.
+
+void (*g() throw())(); // { dg-error "g\\(\\) throw" "" }
+void (*g())(); // { dg-error "" "" }