public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix error recovery in toplev::finalize.
Date: Mon, 28 Feb 2022 13:55:23 +0100	[thread overview]
Message-ID: <CAFiYyc3G-CFCUedfsw6zEw2RAE3uUS5JH+_NJ+4hfZvhTNtmJw@mail.gmail.com> (raw)
In-Reply-To: <5d9fe598-1f3d-a756-2eab-d287cda5f46e@suse.cz>

On Mon, Feb 28, 2022 at 12:49 PM Martin Liška <mliska@suse.cz> wrote:
>
> Use flag_checking instead of CHECKING_P
> and run toplev::finalize only if there is not error seen.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?

OK.

Richard.

> Thanks,
> Martin
>
>         PR ipa/104648
>
> gcc/ChangeLog:
>
>         * main.cc (main): Use flag_checking instead of CHECKING_P
>         and run toplev::finalize only if there is not error seen.
>
> gcc/testsuite/ChangeLog:
>
>         * g++.dg/pr104648.C: New test.
> ---
>   gcc/main.cc                     | 6 +++---
>   gcc/testsuite/g++.dg/pr104648.C | 9 +++++++++
>   2 files changed, 12 insertions(+), 3 deletions(-)
>   create mode 100644 gcc/testsuite/g++.dg/pr104648.C
>
> diff --git a/gcc/main.cc b/gcc/main.cc
> index f9dd6b2af58..4ba28b7de53 100644
> --- a/gcc/main.cc
> +++ b/gcc/main.cc
> @@ -37,9 +37,9 @@ main (int argc, char **argv)
>                  true /* init_signals */);
>
>     int r = toplev.main (argc, argv);
> -#if CHECKING_P
> -  toplev.finalize ();
> -#endif
> +
> +  if (flag_checking && !seen_error ())
> +    toplev.finalize ();
>
>     return r;
>   }
> diff --git a/gcc/testsuite/g++.dg/pr104648.C b/gcc/testsuite/g++.dg/pr104648.C
> new file mode 100644
> index 00000000000..b8b7c2864cf
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/pr104648.C
> @@ -0,0 +1,9 @@
> +// { dg-do compile }
> +// { dg-options "-fvtable-verify=preinit" }
> +
> +struct A {};
> +struct B : virtual A
> +{
> +  B () {};
> +  B () {}; /* { dg-error "cannot be overloaded with" } */
> +};
> --
> 2.35.1
>

  reply	other threads:[~2022-02-28 12:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 11:49 Martin Liška
2022-02-28 12:55 ` Richard Biener [this message]
2022-02-28 15:30 ` David Malcolm
2022-02-28 17:47   ` Richard Biener
2022-02-28 19:21     ` David Malcolm

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=CAFiYyc3G-CFCUedfsw6zEw2RAE3uUS5JH+_NJ+4hfZvhTNtmJw@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /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).