From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A152A3857B9E; Tue, 11 Oct 2022 20:07:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A152A3857B9E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665518829; bh=ZkfY9vaYkzuJxRR0VxgmD4WPu7vcNtrDzFO8Yd4qfak=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a4658ugBayHmMhpH1PDJQW0FVQZ/rX3Xrt75jjyuHRU2OQaTF/oOAQNF1TOAD0m4W /h//uEHsofoOnG5H9qhjoDWp7/YxAkgcaOwVwhGrgmvOwwXWNGdYQqBF/l7b7uu1x6 rUM/8OHgYLW2mwRTxmxXWIUWM1XAATgt/gu0WjS8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107222] const qualifier appears in mangled NTTP value when the original object is so qualified Date: Tue, 11 Oct 2022 20:07:09 +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: 13.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed cf_reconfirmed_on bug_status keywords 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107222 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2022-10-11 Status|UNCONFIRMED |NEW Keywords| |ABI, wrong-code --- Comment #1 from Andrew Pinski --- Here is one which shows the issue at link time. This should link and run. One testcase: ``` 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(); template<> void print{}>() { } int main() { constexpr q x =3D make_q(); constexpr q x1 =3D make_q<(Y){.a=3D{1}}>(); print(); print(); } ``` Another one: ``` 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 {}; } void print(q<(Y){.a=3D{1}}> a) { } void print(...); int main() { constexpr q x =3D make_q(); constexpr q x1 =3D make_q<(Y){.a=3D{1}}>(); print(x); print(x1); } ``` clang mangles both x and x1 the same ...=