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++/106304] [modules] ICE compiling dynamic_cast in constexpr function (in tree_node, at cp/module.cc:9183) Date: Fri, 14 Oct 2022 13:07:18 +0000 [thread overview] Message-ID: <bug-106304-4-z4qzYftCEL@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106304-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106304 --- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:d6a488f243acfac4bdbbb0eefbee3ae916159cf5 commit r13-3299-gd6a488f243acfac4bdbbb0eefbee3ae916159cf5 Author: Patrick Palka <ppalka@redhat.com> Date: Fri Oct 14 09:07:01 2022 -0400 c++ modules: ICE with dynamic_cast [PR106304] The FUNCTION_DECL we build for __dynamic_cast has an empty DECL_CONTEXT but trees_out::tree_node expects FUNCTION_DECLs to have non-empty DECL_CONTEXT, thus we crash when streaming out the dynamic_cast in the below testcase. This patch naively fixes this by setting DECL_CONTEXT for __dynamic_cast appropriately. I suppose we should push it into the namespace too, like we do for __cxa_atexit which is similarly lazily declared. PR c++/106304 gcc/cp/ChangeLog: * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node instead of global_namespace. * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and DECL_SOURCE_LOCATION when building dynamic_cast_node. Push it into the namespace. gcc/testsuite/ChangeLog: * g++.dg/modules/pr106304_a.C: New test. * g++.dg/modules/pr106304_b.C: New test.
next prev parent reply other threads:[~2022-10-14 13:07 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-14 17:15 [Bug c++/106304] New: " johelegp at gmail dot com 2022-07-26 10:03 ` [Bug c++/106304] " redi at gcc dot gnu.org 2022-07-26 14:57 ` johelegp at gmail dot com 2022-10-14 13:07 ` cvs-commit at gcc dot gnu.org [this message] 2022-10-14 13:10 ` ppalka at gcc dot gnu.org 2022-10-14 13:22 ` ppalka 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-106304-4-z4qzYftCEL@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).