[Bug c++/93862] [10 Regression] ICE on static_cast of rvalue-reference-to-array of unknown bound [P0338] to its known static bound
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 26 15:20:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93862
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:4a305fa2fd4c9d553b26efa00f868aa1e4416a9f
commit r10-6867-g4a305fa2fd4c9d553b26efa00f868aa1e4416a9f
Author: Marek Polacek <polacek@redhat.com>
Date: Mon Feb 24 14:43:48 2020 -0500
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.
More information about the Gcc-bugs
mailing list