public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7410] Fix error recovery in toplev::finalize.
Date: Mon, 28 Feb 2022 13:02:20 +0000 (GMT)	[thread overview]
Message-ID: <20220228130220.35D083858C83@sourceware.org> (raw)

https://gcc.gnu.org/g:1060d06b4df8836135ed15d020afbd3637dc625b

commit r12-7410-g1060d06b4df8836135ed15d020afbd3637dc625b
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Feb 28 11:58:01 2022 +0100

    Fix error recovery in toplev::finalize.
    
            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.

Diff:
---
 gcc/main.cc                     | 6 +++---
 gcc/testsuite/g++.dg/pr104648.C | 9 +++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

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" } */
+};


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

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220228130220.35D083858C83@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).