From: Jason Merrill <jason@redhat.com>
To: Matthias Kretz <m.kretz@gsi.de>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: Output less irrelevant info for function template decl [PR100716]
Date: Thu, 27 May 2021 11:07:40 -0400 [thread overview]
Message-ID: <cfcd4d66-66f6-7886-2175-c2d5d104c9eb@redhat.com> (raw)
In-Reply-To: <2208926.MkxnEukozC@excalibur>
On 5/26/21 5:29 PM, Matthias Kretz wrote:
> New revision which can also be compiled with GCC 4.8.
>
> From: Matthias Kretz <kretz@kde.org>
>
> Ensure dump_template_decl for function templates never prints template
> parameters after the function name (it did with -fno-pretty-templates)
> and skip output of irrelevant & confusing "[with T = T]" in
> dump_substitution.
>
> gcc/cp/ChangeLog:
>
> PR c++/100716
> * error.c (dump_template_bindings): Include code to print
> "[with" and ']', conditional on whether anything is printed at
> all. This is tied to whether a semicolon is needed to separate
> multiple template parameters. If the template argument repeats
> the template parameter (T = T), then skip the parameter.
This description should really be in a comment in the code, rather than
the ChangeLog. OK either way.
> (dump_substitution): Moved code to print "[with" and ']' to
> dump_template_bindings.
> (dump_function_decl): Partial revert of PR50828, which masked
> TFF_TEMPLATE_NAME for all of dump_function_decl. Now
> TFF_TEMPLATE_NAME is masked for the scope of the function and
> only carries through to dump_function_name.
> (dump_function_name): Avoid calling dump_template_parms if
> TFF_TEMPLATE_NAME is set.
>
> gcc/testsuite/ChangeLog:
>
> PR c++/100716
> * g++.dg/diagnostic/pr100716.C: New test.
> * g++.dg/diagnostic/pr100716-1.C: Same test with
> -fno-pretty-templates.
> ---
> gcc/cp/error.c | 59 +++++++++++++++-----
> gcc/testsuite/g++.dg/diagnostic/pr100716-1.C | 54 ++++++++++++++++++
> gcc/testsuite/g++.dg/diagnostic/pr100716.C | 54 ++++++++++++++++++
> 3 files changed, 152 insertions(+), 15 deletions(-)
> create mode 100644 gcc/testsuite/g++.dg/diagnostic/pr100716-1.C
> create mode 100644 gcc/testsuite/g++.dg/diagnostic/pr100716.C
>
>
> --
> ──────────────────────────────────────────────────────────────────────────
> Dr. Matthias Kretz https://mattkretz.github.io
> GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
> std::experimental::simd https://github.com/VcDevel/std-simd
> ──────────────────────────────────────────────────────────────────────────
>
next prev parent reply other threads:[~2021-05-27 15:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 19:16 Matthias Kretz
2021-05-26 21:29 ` Matthias Kretz
2021-05-27 15:07 ` Jason Merrill [this message]
2021-05-27 15:25 ` Matthias Kretz
2021-05-27 21:17 ` Jason Merrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cfcd4d66-66f6-7886-2175-c2d5d104c9eb@redhat.com \
--to=jason@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=m.kretz@gsi.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).