From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 000A83847825; Tue, 1 Jun 2021 13:41:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 000A83847825 From: "vopl at bk dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100825] function signature constraints are not a part of mangled name Date: Tue, 01 Jun 2021 13:41:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: vopl at bk dot ru 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: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 13:41:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100825 --- Comment #6 from vopl at bk dot ru --- (In reply to Jonathan Wakely from comment #5) > Yes, I realise that, but I think that is the same rule that means you can= 't > change the result of overload resolution for a given call,=20 But I have a precedent: void foo(char) {} void useFirst() { foo(0); // "void foo(char)" used, no "void foo(int)" visible at now } void foo(int) {} // introduce second function void useSecond() { foo(0); // "void foo(int)" selected as more suitable } > which is why the > second definition gets emitted using the same symbol name as the first. [defns.signature.templ] states that trailing require-clause is a part of function signature, so these are two different functions: template void foo() {} template void foo() requires true {} Since the signature is the basis for name mangling - different names are expected for different functions.. > If the constrained overload is declared before the first call to foo= () > then there is no error. Aha, in such situation there is an only call, no second one, so, no second symbol and no conflicts. Thanks.=