[Bug c/98397] C2X: pointers to arrays with qualifiers are now pointers to qualified types
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Aug 22 22:15:43 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98397
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Uecker <uecker@gcc.gnu.org>:
https://gcc.gnu.org/g:972eab51f53d1db26864ec7d62d40c2ff83407ec
commit r12-3060-g972eab51f53d1db26864ec7d62d40c2ff83407ec
Author: Martin Uecker <muecker@gwdg.de>
Date: Sun Aug 22 23:47:58 2021 +0200
Correct treatment of qualifiers for pointers to arrays for C2X [PR98397]
2021-08-22 Martin Uecker <muecker@gwdg.de>
gcc/c/
PR c/98397
* c-typeck.c (comp_target_types): Change pedwarn to pedwarn_c11
for pointers to arrays with qualifiers.
(build_conditional_expr): For C23 don't lose qualifiers for
pointers
to arrays when the other pointer is a void pointer. Update
warnings.
(convert_for_assignment): Update warnings for C2X when converting
from
void* with qualifiers to a pointer to array with the same
qualifiers.
gcc/testsuite/
PR c/98397
* gcc.dg/c11-qual-1.c: New test.
* gcc.dg/c2x-qual-1.c: New test.
* gcc.dg/c2x-qual-2.c: New test.
* gcc.dg/c2x-qual-3.c: New test.
* gcc.dg/c2x-qual-4.c: New test.
* gcc.dg/c2x-qual-5.c: New test.
* gcc.dg/c2x-qual-6.c: New test.
* gcc.dg/c2x-qual-7.c: New test.
* gcc.dg/pointer-array-quals-1.c: Remove unnecessary flag.
* gcc.dg/pointer-array-quals-2.c: Remove unnecessary flag.
More information about the Gcc-bugs
mailing list