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++/99040] [modules] partitions & using declarations
Date: Fri, 12 Feb 2021 21:50:17 +0000	[thread overview]
Message-ID: <bug-99040-4-xEh2LPAXAV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99040-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99040

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathan Sidwell <nathan@gcc.gnu.org>:

https://gcc.gnu.org/g:0c27fe96f812df76ca07272d3c68765bd1f9dc08

commit r11-7229-g0c27fe96f812df76ca07272d3c68765bd1f9dc08
Author: Nathan Sidwell <nathan@acm.org>
Date:   Fri Feb 12 06:55:49 2021 -0800

    c++: Register streamed-in decls when new [PR 99040]

    With modules one can have using-decls refering to their own scope.  This
    is the way to export things from the GMF or from an import.  The
    problem was I was using current_ns == CP_DECL_CONTEXT (decl) to
    determine whether a decl should be registered in a namespace level or
    not.  But that's an inadequate check and we ended up reregistering
    decls and creating a circular list.  We should be registering the decl
    when first encountered -- whether we bind it is orthogonal to that.

            PR c++/99040
            gcc/cp/
            * module.cc (trees_in::decl_value): Call add_module_namespace_decl
            for new namespace-scope entities.
            (module_state::read_cluster): Don't call add_module_decl here.
            * name-lookup.h (add_module_decl): Rename to ...
            (add_module_namespace_decl): ... this.
            * name-lookup.c (newbinding_bookkeeping): Move into ...
            (do_pushdecl): ... here.  Its only remaining caller.
            (add_module_decl): Rename to ...
            (add_module_namespace_decl): ... here.  Add checking-assert for
            circularity. Don't call newbinding_bookkeeping, just extern_c
            checking and incomplete var checking.
            gcc/testsuite/
            * g++.dg/modules/pr99040_a.C: New.
            * g++.dg/modules/pr99040_b.C: New.
            * g++.dg/modules/pr99040_c.C: New.
            * g++.dg/modules/pr99040_d.C: New.

  parent reply	other threads:[~2021-02-12 21:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 18:31 [Bug c++/99040] New: " nathan at gcc dot gnu.org
2021-02-10 21:05 ` [Bug c++/99040] " nathan at gcc dot gnu.org
2021-02-12 21:50 ` cvs-commit at gcc dot gnu.org
2021-02-12 21:50 ` cvs-commit at gcc dot gnu.org [this message]
2021-02-12 21:51 ` nathan 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-99040-4-xEh2LPAXAV@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: 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).