Avoid assuming a VLA access specification string contains a closing bracket (PR middl...
authorMartin Sebor <msebor@redhat.com>
Wed, 30 Sep 2020 18:58:09 +0000 (12:58 -0600)
committerMartin Sebor <msebor@redhat.com>
Wed, 30 Sep 2020 18:59:53 +0000 (12:59 -0600)
commit7dbc7ad524a540e34ce25d120d0968f36c571bbb
tree245770a1d21bc0447338a70798ca0796c1bebf59
parente808f3fdfa8f31066da19011b55acb8c0446c72d
Avoid assuming a VLA access specification string contains a closing bracket (PR middle-end/97189).

Resolves:
PR middle-end/97189 - ICE on redeclaration of a function with VLA argument and attribute access

gcc/ChangeLog:

PR middle-end/97189
* attribs.c (attr_access::array_as_string): Avoid assuming a VLA
access specification string contains a closing bracket.

gcc/c-family/ChangeLog:

PR middle-end/97189
* c-attribs.c (append_access_attr): Use the function declaration
location for a warning about an attribute access argument.

gcc/testsuite/ChangeLog:

PR middle-end/97189
* gcc.dg/attr-access-2.c: Adjust caret location.
* gcc.dg/Wvla-parameter-6.c: New test.
* gcc.dg/Wvla-parameter-7.c: New test.
gcc/attribs.c
gcc/c-family/c-attribs.c
gcc/testsuite/gcc.dg/Wvla-parameter-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wvla-parameter-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/attr-access-2.c