public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110447] New: [modules] unexpected attachment of GMF decls to a named module.
@ 2023-06-28  8:46 iains at gcc dot gnu.org
  2023-06-28  8:48 ` [Bug c++/110447] " iains at gcc dot gnu.org
  2024-03-13 17:53 ` ppalka at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: iains at gcc dot gnu.org @ 2023-06-28  8:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110447
           Summary: [modules] unexpected attachment of GMF decls to a
                    named module.
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

While trying to compare behaviour of GCC and clang ....

====

Foo.cpp:

module;

#include <iostream>

export module Foo;

export void
my_hello (const char *str)
{
 std::cout << str << std::endl;
}

====
pr61465.cpp:

import Foo; // assume module 'foo' contain the declarations from `<iostream>`
#include <iostream>

int main(int argc, char *argv[])
{
    std::cout << "Test\n";
    my_hello ("and we used Foo");
    return 0;
}

====

g++ -std=c++20 -fmodules-ts Foo.cpp -c
g++ -std=c++20 -fmodules-ts pr6145-main.cpp Foo.o -o t -flang-info-module-cmi

...

In module imported at pr6145-main.cpp:1:1:
Foo: note: reading CMI ‘gcm.cache/Foo.gcm’

<snip include stack traceback>
/usr/include/runetype.h:111:20: error: conflicting declaration ‘_RuneLocale
_DefaultRuneLocale’

<snip include stack traceback>
/usr/include/runetype.h:111:20: note: previous declaration as ‘_RuneLocale@Foo
_DefaultRuneLocale@Foo’

====

NOTE: iostream is _not_ built as a header unit in this case (if we do that the
problem disappears).

----

What seems wrong here is that the _RuneLocale symbol appears to be attached to
Foo - but ir should be part of the GMF of Foo and not visible to importers
(although potentially reachable if used in the module purview of Foo).

unless i miss something?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/110447] [modules] unexpected attachment of GMF decls to a named module.
  2023-06-28  8:46 [Bug c++/110447] New: [modules] unexpected attachment of GMF decls to a named module iains at gcc dot gnu.org
@ 2023-06-28  8:48 ` iains at gcc dot gnu.org
  2024-03-13 17:53 ` ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: iains at gcc dot gnu.org @ 2023-06-28  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at acm dot org

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
note that if I reverse the include/import order like so...

#include <iostream>
import Foo; // assume module 'foo' contain the declarations from `<iostream>`

all is (or at least appears to be) OK.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/110447] [modules] unexpected attachment of GMF decls to a named module.
  2023-06-28  8:46 [Bug c++/110447] New: [modules] unexpected attachment of GMF decls to a named module iains at gcc dot gnu.org
  2023-06-28  8:48 ` [Bug c++/110447] " iains at gcc dot gnu.org
@ 2024-03-13 17:53 ` ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-13 17:53 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
dup of PR99000 AFAICT

*** This bug has been marked as a duplicate of bug 99000 ***

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-13 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-28  8:46 [Bug c++/110447] New: [modules] unexpected attachment of GMF decls to a named module iains at gcc dot gnu.org
2023-06-28  8:48 ` [Bug c++/110447] " iains at gcc dot gnu.org
2024-03-13 17:53 ` ppalka at gcc dot gnu.org

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).