Always keep unset fields in FPOptionsOverride zeroed.

There are three fields that the FPOptions default constructor sets to
non-zero values; those fields previously could have been zero or
non-zero depending on whether they'd been explicitly removed from the
FPOptionsOverride set. However, that doesn't seem to ever actually
happen, so this is NFC, except that it makes the AST file representation
of FPOptionsOverride make more sense.
This commit is contained in:
Richard Smith 2020-08-16 15:44:51 -07:00
parent ae3067055b
commit ae500e4d09
2 changed files with 5 additions and 1 deletions

View File

@ -475,7 +475,7 @@ public:
/// The is implemented as a value of the new FPOptions plus a mask showing which
/// fields are actually set in it.
class FPOptionsOverride {
FPOptions Options;
FPOptions Options = FPOptions(0);
FPOptions::storage_type OverrideMask = 0;
public:

View File

@ -6,6 +6,10 @@
// RUN: cmp %t/a.pch %t/b.pch
#pragma float_control(push)
double fp_control_0(double x) {
return -x + x;
}
double fp_control_1(double x) {
#pragma float_control(precise, on)
return -x + x;