Use 'unsigned' for enum bitfields
authorReid Kleckner <rnk@google.com>
Thu, 30 Mar 2017 01:12:08 +0000 (01:12 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 30 Mar 2017 01:12:08 +0000 (01:12 +0000)
Fixes this clang warning on Windows:

warning: implicit truncation from 'clang::LangOptions::FPContractModeKind' to bit-field changes value from 2 to -2 [-Wbitfield-constant-conversion]
    fp_contract = LangOptions::FPC_Fast;
                ^ ~~~~~~~~~~~~~~~~~~~~~
llvm-svn: 299045

clang/include/clang/Basic/LangOptions.h

index e684ec1..20a0e58 100644 (file)
@@ -224,7 +224,7 @@ public:
 
 private:
   /// Adjust BinaryOperator::FPFeatures to match the bit-field size of this.
-  LangOptions::FPContractModeKind fp_contract : 2;
+  unsigned fp_contract : 2;
 };
 
 /// \brief Describes the kind of translation unit being processed.