From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C9B1B3858D28; Fri, 22 Sep 2023 21:00:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9B1B3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695416450; bh=rcnmpxFuVC8OarTFGXPIrvqAlenYx8z3KfmEJ0+bx1Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BwsdaW2EroalAT0cO4AjLaBtNQBQVO8RA1zplWRuzq/EZnJ8ZdPQimsvaFUsuTpbJ 7711ybedorGTyyANhpvz093KVcGs4vQ8/RVm90ESy8dfR2h3s3Jsakz3jtQ8Gv7bBx TbMgA0YlK45alGPmKZ9ShWdeOkEm/RsgV52N5088= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111544] [14 regression] assignment of read-only location after r14-4111-g6e92a6a2a72d3b Date: Fri, 22 Sep 2023 21:00:50 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111544 --- Comment #10 from Andrew Pinski --- (In reply to Andrew Pinski from comment #7) > Actually this is the reduced testcase: > ``` > struct bs > { > int * const t; > }; > template > struct a > { > int * const t; > a &f(const a&, int *const tt, const a *c, const bs&); > }; >=20 > template > a & a::f(const a &b, int *const tt, const a *c, const bs &d) > { > t =3D c->t; > t =3D b.t; > // t =3D d.t; > // t =3D tt; > return *this; > } > ``` >=20 > clang accepts each of the above statements except for the commented out > ones. Not even in pedantic mode they reject them. Clang does reject it if it is instantiated: ``` void g(a<1> &a1, bs &d) { a1.f(a1,nullptr,&a1, d); } ``` So clang most likely thinks b.t and c->t are still type depedent even though they don't need to be ...=