Commit Graph

2 Commits

Author SHA1 Message Date
Serge Pavlov 08bb5d9196 [FPEnv] Tests for rounding properties of constant evalution
These are moved from D88498.

Differential Revision: https://reviews.llvm.org/D90026
2020-10-29 13:53:13 +07:00
Richard Smith 7e801ca0ef Treat constant contexts as being in the default rounding mode.
This addresses a regression where pretty much all C++ compilations using
-frounding-math now fail, due to rounding being performed in constexpr
function definitions in the standard library.

This follows the "manifestly constant evaluated" approach described in
https://reviews.llvm.org/D87528#2270676 -- evaluations that are required
to succeed at compile time are permitted even in regions with dynamic
rounding modes, as are (unfortunately) the evaluation of the
initializers of local variables of const integral types.

Differential Revision: https://reviews.llvm.org/D89360
2020-10-16 13:26:15 -07:00