public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95158] [8/9 Regression] Templates + Diamond Inheritance + Final = Pure Virtual Function Call Date: Tue, 24 Nov 2020 17:57:48 +0000 [thread overview] Message-ID: <bug-95158-4-Rn973qCb04@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-95158-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95158 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-8 branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:a2bdff4f24d9065791e6d8820004772b9fe0c4c1 commit r8-10637-ga2bdff4f24d9065791e6d8820004772b9fe0c4c1 Author: Jason Merrill <jason@redhat.com> Date: Wed Jun 3 23:50:06 2020 -0400 c++: Fix FE devirt with diamond inheritance [PR95158] This started breaking in GCC 8 because of the fix for PR15272; after that change, we (correctly) remember the lookup from template parsing time that found Base::foo through the non-dependent MiddleB base, and so we overlook the overrider in MiddleA. But given that, the devirtualization condition from the fix for PR59031 is insufficient; we know that d has to be a Derived, and we found Base::foo in Base, but forcing a non-virtual call gets the wrong function. Fixed by removing the PR59031 code, and instead looking up the overrider in BINFO_VIRTUALS. gcc/cp/ChangeLog: PR c++/95158 * class.c (lookup_vfn_in_binfo): New. * call.c (build_over_call): Use it. (build_new_method_call_1): Don't set LOOKUP_NONVIRTUAL. * cp-tree.h (resolves_to_fixed_type_p): Add default argument. (lookup_vfn_in_binfo): Declare. gcc/testsuite/ChangeLog: PR c++/95158 * g++.dg/template/virtual5.C: New test.
next prev parent reply other threads:[~2020-11-24 17:57 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-15 22:59 [Bug c++/95158] New: " sudgylacmoe at gmail dot com 2020-05-18 5:55 ` [Bug c++/95158] [10/11 Regression] " rguenth at gcc dot gnu.org 2020-05-26 21:44 ` jason at gcc dot gnu.org 2020-05-26 21:52 ` jason at gcc dot gnu.org 2020-05-26 21:54 ` jason at gcc dot gnu.org 2020-06-02 17:07 ` paolo.carlini at oracle dot com 2020-06-03 21:33 ` jason at gcc dot gnu.org 2020-06-04 19:11 ` cvs-commit at gcc dot gnu.org 2020-06-04 19:13 ` cvs-commit at gcc dot gnu.org 2020-06-04 19:16 ` [Bug c++/95158] [8/9 " jason at gcc dot gnu.org 2020-11-24 17:57 ` cvs-commit at gcc dot gnu.org [this message] 2020-11-24 17:58 ` cvs-commit at gcc dot gnu.org 2020-11-24 17:58 ` jason at gcc dot gnu.org
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=bug-95158-4-Rn973qCb04@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).