From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4C2463858C53; Mon, 8 May 2023 16:48:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C2463858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683564496; bh=mZcHTe58+thzWYk9afq3zZvb5MxWnWBKetIt9DnsrwI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=K82wv8IHZqca9Cl5ks4v+0mWkb8/cQWgV9pW2fyLuSv1EVjtBx5Atk0H5y29rVP/V YDzov7O6r+OspG+Bv+jJP3jVxxmruHLwDUSWs3mxK4Jw3g1yYLwyD5QRap4En1reu7 XnZS9rYoGebTdgg1TwSv54FueW9w5WMmDyg2BGrI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109775] gcc misidentifies a VLA Date: Mon, 08 May 2023 16:48:16 +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.1.0 X-Bugzilla-Keywords: diagnostic 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: 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=3D109775 --- Comment #4 from Andrew Pinski --- Here is another related testcase: ``` typedef int T; void naimul(const T v_[2]) { int i =3D 0; T pp(T(v_[0])+0); } ``` We get an -pedantic-error dealing with 0 sized array: : In function 'void naimul(const T*)': :5:13: error: ISO C++ forbids zero-size array 'v_' [-Wpedantic] 5 | T pp(T(v_[0])+0); | ^=