aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-10-03 16:29:07 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-10-03 16:29:07 +0000
commit4d4e036d312737ad346b092a4e9289dae2067188 (patch)
tree84895d6f0fd1e1cc6c70307db98155f13c421fae /gcc/cp/error.c
parent2f07423c8c234c5a5739b1c26d37e4d52d539375 (diff)
downloadgcc-4d4e036d312737ad346b092a4e9289dae2067188.zip
gcc-4d4e036d312737ad346b092a4e9289dae2067188.tar.gz
gcc-4d4e036d312737ad346b092a4e9289dae2067188.tar.bz2
re PR c++/37719 (incorrect type on warning of mismatched exception specification with templates)
/cp 2008-10-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/37719 * error.c (dump_function_decl): Save the exceptions in case of error about incompatible specifications in a specialization. /testsuite 2008-10-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/37719 * g++.dg/template/error36.C: New. From-SVN: r140855
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index b8330c3..4064ad40 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1084,11 +1084,16 @@ dump_function_decl (tree t, int flags)
tree template_parms = NULL_TREE;
int show_return = flags & TFF_RETURN_TYPE || flags & TFF_DECL_SPECIFIERS;
int do_outer_scope = ! (flags & TFF_UNQUALIFIED_NAME);
+ tree exceptions;
flags &= ~TFF_UNQUALIFIED_NAME;
if (TREE_CODE (t) == TEMPLATE_DECL)
t = DECL_TEMPLATE_RESULT (t);
+ /* Save the exceptions, in case t is a specialization and we are
+ emitting an error about incompatible specifications. */
+ exceptions = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (t));
+
/* Pretty print template instantiations only. */
if (DECL_USE_TEMPLATE (t) && DECL_TEMPLATE_INFO (t))
{
@@ -1153,7 +1158,7 @@ dump_function_decl (tree t, int flags)
if (flags & TFF_EXCEPTION_SPECIFICATION)
{
pp_base (cxx_pp)->padding = pp_before;
- dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags);
+ dump_exception_spec (exceptions, flags);
}
if (show_return)