public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nathanieloshead at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/104221] member functions defined in separate files of classes declared in module partitions won't compile
Date: Thu, 04 Jan 2024 05:03:10 +0000	[thread overview]
Message-ID: <bug-104221-4-optRk61Y5q@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104221-4@http.gcc.gnu.org/bugzilla/>

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

Nathaniel Shead <nathanieloshead at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathanieloshead at gmail dot com

--- Comment #1 from Nathaniel Shead <nathanieloshead at gmail dot com> ---
I think this is IFNDR; you cannot have more than one partition with the same
name. See https://eel.is/c++draft/module.unit#3:

> A module partition is a module unit whose module-declaration contains
> a module-partition. A named module shall not contain multiple module
> partitions with the same module-partition. All module partitions of a
> module that are module interface units shall be directly or indirectly
> exported by the primary module interface unit ([module.import]).
> No diagnostic is required for a violation of these rules.

And in particular, unlike a module implementation unit, a module partition does
not implicitly import anything; see https://eel.is/c++draft/module.unit#8 which
says:

> A module-declaration that contains neither an export-keyword nor a
> module-partition implicitly imports the primary module interface unit
> of the module as if by a module-import-declaration.

So this is working as specified. I don't think there'd be any good way of
improving the diagnostics for this either.

      reply	other threads:[~2024-01-04  5:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 11:15 [Bug c++/104221] New: " f.b.brokken at rug dot nl
2024-01-04  5:03 ` nathanieloshead at gmail dot com [this message]

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-104221-4-optRk61Y5q@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).