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++/103081] [ICE] with "using enum" Date: Sat, 03 Dec 2022 15:28:39 +0000 [thread overview] Message-ID: <bug-103081-4-wf5H1858fP@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103081-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103081 --- Comment #10 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:b3912122c9dfaba6c8229e8f095885f69782ceda commit r13-4477-gb3912122c9dfaba6c8229e8f095885f69782ceda Author: Patrick Palka <ppalka@redhat.com> Date: Sat Dec 3 10:28:25 2022 -0500 c++: substituting CONST_DECL_USING_P enumerators [PR103081] We implement class-scope using enum by injecting clones of the enum's CONST_DECLs as fields of the class, for which CONST_DECL_USING_P is true, so that qualified lookup naturally finds the enumerators. Substitution into such a CONST_DECL currently ICEs however, because we assume the DECL_CONTEXT is always the ENUMERAL_TYPE (which has TYPE_VALUES) but in this case it's the RECORD_TYPE for the class scope (which has TYPE_FIELDS). Since these CONST_DECLs appear to always be non-dependent, this patch fixes this by shortcutting substitution for CONST_DECLs that have non-dependent DECL_CONTEXT. This subsumes the existing (and seemingly dead) DECL_NAMESPACE_SCOPE_P early exit test and also benefits substitution into ordinary non-dependent CONST_DECLs. PR c++/103081 gcc/cp/ChangeLog: * pt.cc (tsubst_copy) <case CONST_DECL>: Generalize early exit test for namespace-scope decls to check dependence of the enclosing scope instead. Remove dead early exit test. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/using-enum-10.C: New test. * g++.dg/cpp2a/using-enum-10a.C: New test.
next prev parent reply other threads:[~2022-12-03 15:28 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-04 14:30 [Bug c++/103081] New: " terra at gnome dot org 2021-11-04 14:51 ` [Bug c++/103081] " mpolacek at gcc dot gnu.org 2021-11-04 14:56 ` mpolacek at gcc dot gnu.org 2021-11-04 14:57 ` rguenth at gcc dot gnu.org 2021-11-04 15:15 ` terra at gnome dot org 2022-10-30 18:54 ` pinskia at gcc dot gnu.org 2022-10-30 18:55 ` pinskia at gcc dot gnu.org 2022-10-31 0:30 ` chris-gcc-bugzilla at cybermato dot com 2022-10-31 0:32 ` pinskia at gcc dot gnu.org 2022-10-31 0:50 ` chris-gcc-bugzilla at cybermato dot com 2022-12-02 19:13 ` ppalka at gcc dot gnu.org 2022-12-03 15:28 ` cvs-commit at gcc dot gnu.org [this message] 2022-12-03 15:29 ` ppalka at gcc dot gnu.org 2022-12-19 16:54 ` cvs-commit at gcc dot gnu.org 2022-12-19 16:56 ` 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-103081-4-wf5H1858fP@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).