[PATCH] D31167: Use FPContractModeKind universally

Adam Nemet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 29 20:17:18 PDT 2017


anemet added inline comments.


================
Comment at: cfe/trunk/include/clang/Basic/LangOptions.h:217
   /// Adjust BinaryOperator::FPFeatures to match the bit-field size of this.
-  unsigned fp_contract : 1;
+  LangOptions::FPContractModeKind fp_contract : 2;
 };
----------------
rnk wrote:
> Please do not use bitfields with enum types, it's a good way to break the build on Windows. This change triggered this clang-cl warning:
> ```
> C:\src\llvm-project\clang\include\clang/Basic/LangOptions.h(208,17):  warning: implicit truncation from 'clang::LangOptions::FPContractModeKind' to bit-field changes value from 2 to -2 [-Wbitfield-constant-conversion]
>     fp_contract = LangOptions::FPC_Fast;
>                 ^ ~~~~~~~~~~~~~~~~~~~~~
> ```
Noted and thanks for the fix!  Unfortunately the warning wasn't showing up on my host.  I'll take a look why.


Repository:
  rL LLVM

https://reviews.llvm.org/D31167





More information about the cfe-commits mailing list