public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-9895] c++: don't ICE on NAMESPACE_DECL inside FUNCTION_DECL Date: Thu, 21 Apr 2022 09:23:37 +0000 (GMT) [thread overview] Message-ID: <20220421092337.DC08038425A4@sourceware.org> (raw) https://gcc.gnu.org/g:1eee4e08a64f6e931b0c5dd1bb854a2b7ad3d58f commit r11-9895-g1eee4e08a64f6e931b0c5dd1bb854a2b7ad3d58f Author: Matthias Kretz <m.kretz@gsi.de> Date: Wed Dec 15 09:45:06 2021 +0100 c++: don't ICE on NAMESPACE_DECL inside FUNCTION_DECL Code like void swap() { namespace __variant = __detail::__variant; ... } create a NAMESPACE_DECL where the CP_DECL_CONTEXT is a FUNCTION_DECL. DECL_TEMPLATE_INFO fails on NAMESPACE_DECL and therefore must be handled first in the assertion. Signed-off-by: Matthias Kretz <m.kretz@gsi.de> gcc/cp/ChangeLog: * module.cc (trees_out::get_merge_kind): NAMESPACE_DECLs also cannot have a DECL_TEMPLATE_INFO. (cherry picked from commit 6bcb6ed5a44b6f271891246ef7ae568bfdc14e9c) Diff: --- gcc/cp/module.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index b97b1bcb2f8..6cb926c044a 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -10059,9 +10059,10 @@ trees_out::get_merge_kind (tree decl, depset *dep) tree ctx = CP_DECL_CONTEXT (decl); if (TREE_CODE (ctx) == FUNCTION_DECL) { - /* USING_DECLs cannot have DECL_TEMPLATE_INFO -- this isn't - permitting them to have one. */ + /* USING_DECLs and NAMESPACE_DECLs cannot have DECL_TEMPLATE_INFO -- + this isn't permitting them to have one. */ gcc_checking_assert (TREE_CODE (decl) == USING_DECL + || TREE_CODE (decl) == NAMESPACE_DECL || !DECL_LANG_SPECIFIC (decl) || !DECL_TEMPLATE_INFO (decl));
reply other threads:[~2022-04-21 9:23 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=20220421092337.DC08038425A4@sourceware.org \ --to=jakub@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: 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).