diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-18 12:51:28 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-18 12:51:28 +0000 |
commit | 4afe894b25703c4ae9c49775dfc162e066b52e9e (patch) | |
tree | bbf98d9a04aae9c4ebfded82b2bff8a61db8437b /gcc/cp/mangle.c | |
parent | 16603fb6cc03e2a824699d70e31c4786fc84fe13 (diff) | |
download | gcc-4afe894b25703c4ae9c49775dfc162e066b52e9e.tar.gz |
PR c++/79091
* mangle.c (write_exception_spec): Check nothrow explicitly.
(write_encoding): Don't increment processing_template_decl around
encoding.
PR c++/79091
* g++.dg/pr79091.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244575 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index d1b107cbb1d..033660f0091 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -366,17 +366,19 @@ write_exception_spec (tree spec) return; } - if (nothrow_spec_p (spec)) + if (spec == noexcept_true_spec || spec == empty_except_spec) write_string ("Do"); - else if (TREE_PURPOSE (spec)) + else if (tree expr = TREE_PURPOSE (spec)) { - gcc_assert (uses_template_parms (TREE_PURPOSE (spec))); + /* noexcept (expr) */ + gcc_assert (uses_template_parms (expr)); write_string ("DO"); - write_expression (TREE_PURPOSE (spec)); + write_expression (expr); write_char ('E'); } else { + /* throw (type-list) */ write_string ("Dw"); for (tree t = spec; t; t = TREE_CHAIN (t)) write_type (TREE_VALUE (t)); @@ -829,7 +831,6 @@ write_encoding (const tree decl) if (tmpl) { - ++processing_template_decl; fn_type = get_mostly_instantiated_function_type (decl); /* FN_TYPE will not have parameter types for in-charge or VTT parameters. Therefore, we pass NULL_TREE to @@ -846,9 +847,6 @@ write_encoding (const tree decl) write_bare_function_type (fn_type, mangle_return_type_p (decl), d); - - if (tmpl) - --processing_template_decl; } } |