From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 573DB385661E; Wed, 28 Jun 2023 08:46:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 573DB385661E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687941982; bh=ZqeacN9rJgxQ9wLpkxw1DR9pg+RicQJcEBOtjUWdYDM=; h=From:To:Subject:Date:From; b=qkumtPShzvYsGnorPWSeDE5iHdrOtkBLVC6AiblmdXclr+7x+UNI0vI+F7RI3pKWe T2iatgL8Vh9oIcRoUFoHq1UwzxpTsicxQNKtjV+dLLoNW4C9j14GgD6hhANNz7hLv2 zTFq+GtJte5qqZ7OxpuSQHEnyu+bQGZIsohnCs7o= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110447] New: [modules] unexpected attachment of GMF decls to a named module. Date: Wed, 28 Jun 2023 08:46:20 +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: iains at gcc dot gnu.org 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=3D110447 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 .... =3D=3D=3D=3D Foo.cpp: module; #include export module Foo; export void my_hello (const char *str) { std::cout << str << std::endl; } =3D=3D=3D=3D pr61465.cpp: import Foo; // assume module 'foo' contain the declarations from `` #include int main(int argc, char *argv[]) { std::cout << "Test\n"; my_hello ("and we used Foo"); return 0; } =3D=3D=3D=3D g++ -std=3Dc++20 -fmodules-ts Foo.cpp -c g++ -std=3Dc++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 =E2=80=98gcm.cache/Foo.gcm=E2=80=99 /usr/include/runetype.h:111:20: error: conflicting declaration =E2=80=98_Ru= neLocale _DefaultRuneLocale=E2=80=99 /usr/include/runetype.h:111:20: note: previous declaration as =E2=80=98_Run= eLocale@Foo _DefaultRuneLocale@Foo=E2=80=99 =3D=3D=3D=3D 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?=