public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114868] New: [modules] func declared in GMF and exported via using-decl in module partition is not actually exported
@ 2024-04-26 19:19 m.cencora at gmail dot com
  2024-05-01  7:23 ` [Bug c++/114868] " cvs-commit at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: m.cencora at gmail dot com @ 2024-04-26 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114868
           Summary: [modules] func declared in GMF and exported via
                    using-decl in module partition is not actually
                    exported
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m.cencora at gmail dot com
  Target Milestone: ---

$ cat mod.cpp 
export module mod;
export import :part;

export void foo()
{
}

$ cat mod-part.cpp 
module;

#include "bar.hpp"

export module mod:part;

export using ::bar;

export void bar_non_gmf()
{
}

$ cat usage.cpp 
import mod;

int main()
{
    foo();
    bar();
    bar_non_gmf();
}

$ g++ -std=c++2b -fmodules-ts mod-part.cpp mod.cpp usage.cpp
usage.cpp: In function ‘int main()’:
usage.cpp:6:5: error: ‘bar’ was not declared in this scope
    6 |     bar();
      |     ^~~

When I compile mod-part.cpp on its own, it seems that bar symbol is not emitted
in the object file:
$ g++ -std=c++2b -fmodules-ts mod-part.cpp -c -o mod-part.o
$ readelf -s mod-part.o | c++filt

Symbol table '.symtab' contains 5 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS mod-part.cpp
     2: 0000000000000000     0 SECTION LOCAL  DEFAULT    1 .text
     3: 0000000000000000    11 FUNC    GLOBAL DEFAULT    1 bar_non_gmf@mod()
     4: 000000000000000b    11 FUNC    GLOBAL DEFAULT    1 initializer for
module mod:part

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

end of thread, other threads:[~2024-05-24 14:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 19:19 [Bug c++/114868] New: [modules] func declared in GMF and exported via using-decl in module partition is not actually exported m.cencora at gmail dot com
2024-05-01  7:23 ` [Bug c++/114868] " cvs-commit at gcc dot gnu.org
2024-05-01  7:26 ` nshead at gcc dot gnu.org
2024-05-24 14:33 ` cvs-commit at gcc dot gnu.org
2024-05-24 14:35 ` nshead 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).