aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-range.h
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2022-11-30 04:02:07 +0000
committerAndrew Pinski <apinski@marvell.com>2023-04-30 21:48:59 +0000
commitd56af02fb1fd6eb50beb8a1689cf646bc567dbfc (patch)
tree664601021ccd04050c25e90b1388f743b0789a91 /gcc/value-range.h
parenta6b810ae783acf8cec2d2272a46bd6de0976f496 (diff)
downloadgcc-d56af02fb1fd6eb50beb8a1689cf646bc567dbfc.zip
gcc-d56af02fb1fd6eb50beb8a1689cf646bc567dbfc.tar.gz
gcc-d56af02fb1fd6eb50beb8a1689cf646bc567dbfc.tar.bz2
Improve error message for excess elements in array initializer from {"a"}
So char arrays are not the only type that be initialized from {"a"}. We can have wchar_t (L"") and char16_t (u"") types too. So let's print out the type of the array instead of just saying char. Note in the testsuite I used regex . to match '[' and ']' as I could not figure out how many '\' I needed. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/c/ChangeLog: * c-typeck.cc (process_init_element): Print out array type for excessive elements. gcc/testsuite/ChangeLog: * gcc.dg/init-bad-1.c: Update error message. * gcc.dg/init-bad-2.c: Likewise. * gcc.dg/init-bad-3.c: Likewise. * gcc.dg/init-excess-3.c: Likewise. * gcc.dg/pr61096-1.c: Likewise.
Diffstat (limited to 'gcc/value-range.h')
0 files changed, 0 insertions, 0 deletions