aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-infer.cc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2023-02-10 00:42:47 +0000
committerJoseph Myers <joseph@codesourcery.com>2023-02-10 00:42:47 +0000
commitb9f8935e110c392c21460db838b4209c32f070c2 (patch)
tree329ad18e382724a5d148e1cb74b5f66fec86d69e /gcc/gimple-range-infer.cc
parent41015797ad14bc9030a87d102e4ab1ad891345f6 (diff)
downloadgcc-b9f8935e110c392c21460db838b4209c32f070c2.zip
gcc-b9f8935e110c392c21460db838b4209c32f070c2.tar.gz
gcc-b9f8935e110c392c21460db838b4209c32f070c2.tar.bz2
c: Allow conversions of null pointer constants to nullptr_t
WG14 has agreed to allow conversions (explicit and implicit) from null pointer constants to nullptr_t; update GCC's nullptr_t implementation to match. Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/c/ * c-convert.cc (c_convert): Allow conversion of a null pointer constant to nullptr_t. * c-typeck.cc (null_pointer_constant_p): Remove static. (convert_for_assignment): Allow conversion of a null pointer constant to nullptr_t. (digest_init): Handle NULLPTR_TYPE among scalar conversions. * c-tree.h (null_pointer_constant_p): Declare. gcc/testsuite/ * gcc.dg/c2x-nullptr-1.c: Test conversion of null pointer constants to nullptr_t. * gcc.dg/c2x-nullptr-3.c: Do not expect errors for conversion of null pointer constants to nullptr_t. Do test errors for conversion of other values to nullptr_t and for unary '+' on nullptr_t.
Diffstat (limited to 'gcc/gimple-range-infer.cc')
0 files changed, 0 insertions, 0 deletions