aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-03-28 10:30:31 +0100
committerJakub Jelinek <jakub@redhat.com>2020-03-28 10:30:31 +0100
commitc6a562de88c44a555e1688c212869b20b02151bc (patch)
tree06652afc717200815146316b1636c0c737c37422 /gcc/fortran/arith.c
parent679becf175c5d7f6b323cd3af0a09c6039b4123d (diff)
downloadgcc-c6a562de88c44a555e1688c212869b20b02151bc.zip
gcc-c6a562de88c44a555e1688c212869b20b02151bc.tar.gz
gcc-c6a562de88c44a555e1688c212869b20b02151bc.tar.bz2
c: After issuing errors about array size, for error-recovery don't make the array VLA [PR93573]
After we report various errors about array size, we set for error-recovery the size to be 1, but because size_int_const is false, it still means we pretend the array is a VLA, can emit a second diagnostics in that case etc. E.g. $ ./cc1.unpatched -quiet a.c a.c:1:5: error: size of array ‘f’ has non-integer type 1 | int f[100.0]; | ^ a.c:1:1: warning: variably modified ‘f’ at file scope 1 | int f[100.0]; | ^~~ $ ./cc1 -quiet a.c a.c:1:5: error: size of array ‘f’ has non-integer type 1 | int f[100.0]; | ^ 2020-03-28 Jakub Jelinek <jakub@redhat.com> PR c/93573 * c-decl.c (grokdeclarator): After issuing errors, set size_int_const to true after setting size to integer_one_node. * gcc.dg/pr93573-1.c: New test. * gcc.dg/pr93573-2.c: New test.
Diffstat (limited to 'gcc/fortran/arith.c')
0 files changed, 0 insertions, 0 deletions