diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-10-04 18:15:36 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-10-04 18:15:36 +0200 |
commit | 420db57431715a5aed988c5ba600c913dc779f0e (patch) | |
tree | c42d6fb48f73337d2ac55e1a6950c2f94ed3971f /gcc/cp | |
parent | 4e91452412294f3cc1c63de8c35e88d2c08fe6ee (diff) | |
download | gcc-420db57431715a5aed988c5ba600c913dc779f0e.zip gcc-420db57431715a5aed988c5ba600c913dc779f0e.tar.gz gcc-420db57431715a5aed988c5ba600c913dc779f0e.tar.bz2 |
re PR c++/82373 (syntax error in error message)
PR c++/82373
* error.c (dump_function_decl): If show_return, call dump_type_suffix
on the same return type dump_type_prefix has been called on.
* g++.dg/cpp1y/pr82373.C: New test.
From-SVN: r253418
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/error.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b1eaaba..18e4b99 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-10-04 Jakub Jelinek <jakub@redhat.com> + + PR c++/82373 + * error.c (dump_function_decl): If show_return, call dump_type_suffix + on the same return type dump_type_prefix has been called on. + 2017-10-04 Jason Merrill <jason@redhat.com> PR c++/81525 - broken handling of auto in generic lambda. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index e407154..7a98d2e 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1574,6 +1574,7 @@ dump_function_decl (cxx_pretty_printer *pp, tree t, int flags) int do_outer_scope = ! (flags & TFF_UNQUALIFIED_NAME); tree exceptions; bool constexpr_p; + tree ret = NULL_TREE; flags &= ~(TFF_UNQUALIFIED_NAME | TFF_TEMPLATE_NAME); if (TREE_CODE (t) == TEMPLATE_DECL) @@ -1636,7 +1637,7 @@ dump_function_decl (cxx_pretty_printer *pp, tree t, int flags) && !DECL_DESTRUCTOR_P (t) && !deduction_guide_p (t)); if (show_return) { - tree ret = fndecl_declared_return_type (t); + ret = fndecl_declared_return_type (t); dump_type_prefix (pp, ret, flags); } @@ -1677,7 +1678,7 @@ dump_function_decl (cxx_pretty_printer *pp, tree t, int flags) } if (show_return) - dump_type_suffix (pp, TREE_TYPE (fntype), flags); + dump_type_suffix (pp, ret, flags); else if (deduction_guide_p (t)) { pp_cxx_ws_string (pp, "->"); |