From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 04CAD3858004; Fri, 18 Nov 2022 00:46:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04CAD3858004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668732372; bh=aTZCMSai6Ti2a2h9UePNmowZY9A8mjYfB5cYJhx5CR8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P3I3rf72eAUZUmvCwLO0nPETp0cpYRe1yXZj/51wQIpqZMvwEYiWG3s8BdtYQCQqa FAGuc7TaRn0PDdLClkvgC+03Jnt9/a/Cht/4nRaHJOAEDgRGDjXIJbkJa6jXN6s+s2 hm2vXUbwY5SkFZTRZ9cpi1OmroJi5T9mcmKas2Vw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107735] Inconsistent error messages for std::array out of bound due to taking the address of one-past-the-end is valid Date: Fri, 18 Nov 2022 00:46:11 +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: 12.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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: 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=3D107735 --- Comment #3 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #2) > I wonder if this is because doing=20 > constexpr const int *v1 =3D &array[3]; >=20 > is valid and well defined. It's not, but &array.data()[3] is. I agree that's probably the reason for the different diagnostics.=