Support of rounding mode in constant evaluation resulted in some
number of compile errors for constructs that previously were compiled
successfully. For example, the following code starts failing at
compilation if FP exception behavior is set to strict:
struct S { float f; }; static struct S x = {0.63};
This happenes because setting strict behavior sets rounding mode to
dymanic. In this case the value of initializer depends on the current
rounding mode and cannot be evaluated in compile time.
Using dynamic as rounding mode make no sense outside function bodies.
For example, even if the initializer is evaluated dynamically, this happens
before the execution of main, so there is no possibility to set dynamic
rounding mode for it. C requires that initializers are evaluated using
constant rounding mode. It makes sense to apply this rule to C++ as well.
With this change dynamic rounding mode is applied to function bodies. In
other cases, like evaluation of initializers the constant rounding mode
is applied, which is 'tonearest' unless it was changed by '#pragma STDC
FENV_ROUND'.
clang-tidy: warning: 'auto VD' can be declared as 'auto *VD' [llvm-qualified-auto]
not useful