https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124399

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 63853
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63853&action=edit
gcc16-pr124399-2.patch

Regarding the static_assert(annotations_of(^^x)[0] == annotations_of(^^y)[0]);
check, we currently compare the TREE_LIST of the attribute but that is not
guaranteed to be the same for the annotations shared by multiple declarations.
I think we should compare TREE_VALUE instead, then it passes.
But (commented out in the testcase), I think we handle incorrectly
[[=4]] int x [[=5]], y [[=6]];
I think we currently return 5, 4 and 6, 4 as annotations of x and y rather than
4, 5 and 4, 6.

Reply via email to