aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-02-24 14:43:48 -0500
committerMarek Polacek <polacek@redhat.com>2020-02-26 10:18:30 -0500
commit4a305fa2fd4c9d553b26efa00f868aa1e4416a9f (patch)
treebeda3667124a850b4d69abfe295d39726c9d5905 /gcc/cp/init.c
parentb9934ad88d6b27e5cf1a34d88dbefb2bbe928753 (diff)
downloadgcc-4a305fa2fd4c9d553b26efa00f868aa1e4416a9f.zip
gcc-4a305fa2fd4c9d553b26efa00f868aa1e4416a9f.tar.gz
gcc-4a305fa2fd4c9d553b26efa00f868aa1e4416a9f.tar.bz2
c++: Fix ICE with static_cast when converting from int[] [PR93862]
This ICEs since my patch for P0388, which allowed conversions to arrays of unknown bound, but not the reverse, so these two static_casts are ill-formed. [expr.static.cast]/3 says that "cv1 T1" and "cv2 T2" have to be reference-compatible and the comment in build_static_cast_1 says it too but then we actually use reference_related_p... Fixed thus. 2020-02-26 Marek Polacek <polacek@redhat.com> PR c++/93862 - ICE with static_cast when converting from int[]. * call.c (reference_compatible_p): No longer static. * cp-tree.h (reference_compatible_p): Declare. * typeck.c (build_static_cast_1): Use reference_compatible_p instead of reference_related_p. * g++.dg/cpp0x/rv-cast7.C: New test.
Diffstat (limited to 'gcc/cp/init.c')
0 files changed, 0 insertions, 0 deletions