r299045 - Use 'unsigned' for enum bitfields

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 29 18:12:08 PDT 2017


Author: rnk
Date: Wed Mar 29 20:12:08 2017
New Revision: 299045

URL: http://llvm.org/viewvc/llvm-project?rev=299045&view=rev
Log:
Use 'unsigned' for enum bitfields

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;
                ^ ~~~~~~~~~~~~~~~~~~~~~


Modified:
    cfe/trunk/include/clang/Basic/LangOptions.h   (contents, props changed)

Modified: cfe/trunk/include/clang/Basic/LangOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.h?rev=299045&r1=299044&r2=299045&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/LangOptions.h (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.h Wed Mar 29 20:12:08 2017
@@ -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.

Propchange: cfe/trunk/include/clang/Basic/LangOptions.h
------------------------------------------------------------------------------
--- svn:eol-style (original)
+++ svn:eol-style (removed)
@@ -1 +0,0 @@
-native




More information about the cfe-commits mailing list