From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 02AF7385742F; Tue, 6 Sep 2022 13:58:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02AF7385742F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662472694; bh=c2ZQt/n+ZuXwttfWa3FXq25EmCvnGe8fXnB9dlTLbz0=; h=From:To:Subject:Date:From; b=MXJR5tGDX4LI3S1z6xPpMbbAOqo5IImFF/S2AgNvb1qfQXfXkEM2DwIXnCTGvTUkf wh9B0wD5L9Zq+6/w34xMdfw6C5X+I++a2DDzMIxPsdkn6k9htGEKBEzkaIUTCN1gNu P4oidOmvuFQkrcK7UpCJn9XqbI0o0Am02kjXsbiw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106851] New: [modules] Name conflict for exported using-declaration Date: Tue, 06 Sep 2022 13:58:13 +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: 13.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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 keywords bug_severity priority component assigned_to reporter blocked 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=3D106851 Bug ID: 106851 Summary: [modules] Name conflict for exported using-declaration Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Blocks: 103524 Target Milestone: --- $ cat lib.h namespace outer { template void any_of(T) { } namespace inner { struct A { }; inline constexpr A any_of; } } $ gcc -c -std=3Dc++23 -fmodules-ts -x c++-header lib.h $ cat lib.cc export module lib; import "lib.h"; export using outer::any_of; export using outer::inner::any_of; $ gcc -c -std=3Dc++23 -fmodules-ts lib.cc=20 lib.cc:6:28: error: =E2=80=98constexpr const outer::inner::A outer::inner::= any_of=E2=80=99 conflicts with a previous declaration 6 | export using outer::inner::any_of; | ^~~~~~ In module ./lib.h, imported at lib.cc:3: lib.h:2:29: note: previous declaration =E2=80=98void outer::any_of(T)=E2=80= =99 2 | template void any_of(T) { } | ^~~~~~ lib.cc:1:8: warning: not writing module =E2=80=98lib=E2=80=99 due to errors 1 | export module lib; | ^~~~~~ The names are in different scopes, shouldn't they be exported that way too? Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103524 [Bug 103524] [meta-bug] modules issue=