From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4FC193854812; Sat, 17 Apr 2021 21:13:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FC193854812 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100124] Why is "flexible array member '...' in an otherwise empty '...'" an issue? Date: Sat, 17 Apr 2021 21:13:33 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: blocked 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 21:13:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100124 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |69698 --- Comment #5 from Martin Sebor --- G++ accepted structs where a flexible array is the sole member until versio= n 6. G++ 6 tightened up the rules (in r231665) to more closely match the C front end. I suspect Clang implemented the more permissive historical G++ behavi= or in C++ mode for compatibility with G++ and the stricter GCC behavior in C m= ode, and to this day hasn't changed. My impression is that the historical G++ permissiveness was due to oversights rather than deliberate features (we're tracking a few such outstanding issues in pr69698 that are yet to be fixed). Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69698 [Bug 69698] [meta-bug] flexible array members=