From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 937E63858C42; Fri, 26 Apr 2024 19:19:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 937E63858C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714159194; bh=P5aVY+9GvQ0jH0NR3RhdW0kiWacMTIjLC0oAX7YlbUY=; h=From:To:Subject:Date:From; b=fRTuFXb0Jrx0v8wTcxjhQ7mTYt8f+6o/QrzV72MH8wDyj186SJ/G/Tfuq9Y56qAoh 8pNTODT6yoTkGFx1z2pAw70j2g+ggV+viNbBfQRDDjaTxbGeM/fSPmP2VzQkUrcjJp xZulcXlMyxeb/URVHzNQwM0ElauPKbe+I1SnTN6U= From: "m.cencora at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114868] New: [modules] func declared in GMF and exported via using-decl in module partition is not actually exported Date: Fri, 26 Apr 2024 19:19:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: m.cencora at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114868 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=20 export module mod; export import :part; export void foo() { } $ cat mod-part.cpp=20 module; #include "bar.hpp" export module mod:part; export using ::bar; export void bar_non_gmf() { } $ cat usage.cpp=20 import mod; int main() { foo(); bar(); bar_non_gmf(); } $ g++ -std=3Dc++2b -fmodules-ts mod-part.cpp mod.cpp usage.cpp usage.cpp: In function =E2=80=98int main()=E2=80=99: usage.cpp:6:5: error: =E2=80=98bar=E2=80=99 was not declared in this scope 6 | bar(); | ^~~ When I compile mod-part.cpp on its own, it seems that bar symbol is not emi= tted in the object file: $ g++ -std=3Dc++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=20 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=