From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ACA4F3858D28; Tue, 11 Oct 2022 19:52:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACA4F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665517975; bh=ygqjfjHt9qZzkqnp1pCZzsVnF+kxjCblsUxKSFxCQZg=; h=From:To:Subject:Date:From; b=Ia1+SV6CzowPYReOK/Y1B4yapT3A0Qr6nBjRtijBa6OMew9ivBUB1S70oL23+4GRp pKRGPL8vdDYMLocTUBPDAjoJa2V54PWNjZ+a8P18/XnRo4mnkjDoR0PWlQRVZstPAF 6sFECuWYGk2ugVTh8KCDiOqeysb1vLf097eJqQ2M= From: "johelegp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107222] New: const qualifier appears in mangled NTTP value when the original object is so qualified Date: Tue, 11 Oct 2022 19:52:55 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: johelegp 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 cc 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=3D107222 Bug ID: 107222 Summary: const qualifier appears in mangled NTTP value when the original object is so qualified Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://compiler-explorer.com/z/63f9sxnec. ```C++ struct A { int i; }; union Y { A a; }; constexpr Y make_y(const A a) { return {a}; } template struct q { }; template constexpr q make_q() { return {}; } template void print(); int main() { constexpr q x =3D make_q(); print(); // +x; } ``` ``` main: sub rsp, 8 call void print{}>() xor eax, eax add rsp, 8 ret ``` Alternatively, when uncommenting `+x;`: ``` : In function 'int main()': :10:3: error: no match for 'operator+' (operand type is 'const q') 10 | +x; | ^~ ```=