From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 64F4B3857C68; Wed, 30 Jun 2021 22:17:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64F4B3857C68 From: "gcc at alanwu dot email" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/101265] C2X [[maybe_unused]] ignored when placed after array declaration Date: Wed, 30 Jun 2021 22:17:24 +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: 11.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: gcc at alanwu dot email 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: 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: Wed, 30 Jun 2021 22:17:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101265 --- Comment #2 from Alan Wu --- > int thisdoesnt[1] [[maybe_unused]]; > Whereas that one appertains to the array type This seems to contradict the latest document I could find about the attribu= te syntax proposal. From N2335 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2335.pdf: > [[attr1]] int [[attr2]] a[10] [[attr3]], b [[attr4]]; > attr1 appertains to the variable declarations a and b, attr2 > appertains to the type int, attr3 appertains to the variable > declaration a, and attr4 appertains to the variable declaration b. GCC warns about a and b for the following: void foo(void) { int a[10] [[maybe_unused]], b; }=