[all-commits] [llvm/llvm-project] 7e801c: Treat constant contexts as being in the default ro...

Richard Smith via All-commits all-commits at lists.llvm.org
Fri Oct 16 13:27:12 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e801ca0efa99f7cec7a2aea30513ad282030b51
      https://github.com/llvm/llvm-project/commit/7e801ca0efa99f7cec7a2aea30513ad282030b51
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-10-16 (Fri, 16 Oct 2020)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    A clang/test/Sema/rounding-math.c
    A clang/test/SemaCXX/rounding-math.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list