r273835 - in /branches/gcc-9-branch/libstdc++-v...

redi@gcc.gnu.org redi@gcc.gnu.org
Fri Jul 26 13:36:00 GMT 2019


Author: redi
Date: Fri Jul 26 13:36:47 2019
New Revision: 273835

URL: https://gcc.gnu.org/viewcvs?rev=273835&root=gcc&view=rev
Log:
Change std::ceil2 to be undefined if the result can't be represented

Backport from mainline
2019-07-22  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/bit (__ceil2): Make unrepresentable results undefined,
	as per P1355R2. Add debug assertion. Perform one left shift, not two,
	so that out of range values cause undefined behaviour. Ensure that
	shift will still be undefined if left operand is promoted.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Replace checks for
	unrepresentable values with checks that they are not core constant
	expressions.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc: New test.

Added:
    branches/gcc-9-branch/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc
Modified:
    branches/gcc-9-branch/libstdc++-v3/ChangeLog
    branches/gcc-9-branch/libstdc++-v3/include/std/bit
    branches/gcc-9-branch/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2.cc



More information about the Libstdc++-cvs mailing list