[Bug c/101265] C2X [[maybe_unused]] ignored when placed after array declaration
gcc at alanwu dot email
gcc-bugzilla@gcc.gnu.org
Wed Jun 30 22:17:24 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101265
--- Comment #2 from Alan Wu <gcc at alanwu dot email> ---
> 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 attribute
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;
}
More information about the Gcc-bugs
mailing list