r192228 - Explicitly request unsigned enum types when desired

Reid Kleckner reid at kleckner.net
Tue Oct 8 13:20:00 PDT 2013


Author: rnk
Date: Tue Oct  8 15:20:00 2013
New Revision: 192228

URL: http://llvm.org/viewvc/llvm-project?rev=192228&view=rev
Log:
Explicitly request unsigned enum types when desired

This fixes repeated -Wmicrosoft warnings when self-hosting clang on
Windows, and gets us real unsigned enum types with MSVC.

Modified:
    cfe/trunk/include/clang/AST/Comment.h
    cfe/trunk/include/clang/AST/Expr.h
    cfe/trunk/include/clang/Basic/SourceLocation.h

Modified: cfe/trunk/include/clang/AST/Comment.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Comment.h?rev=192228&r1=192227&r2=192228&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Comment.h (original)
+++ cfe/trunk/include/clang/AST/Comment.h Tue Oct  8 15:20:00 2013
@@ -699,7 +699,7 @@ private:
   unsigned ParamIndex;
 
 public:
-  enum {
+  enum LLVM_ENUM_INT_TYPE(unsigned) {
     InvalidParamIndex = ~0U,
     VarArgParamIndex = ~0U/*InvalidParamIndex*/ - 1U
   };

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=192228&r1=192227&r2=192228&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue Oct  8 15:20:00 2013
@@ -4621,7 +4621,7 @@ class PseudoObjectExpr : public Expr {
 public:
   /// NoResult - A value for the result index indicating that there is
   /// no semantic result.
-  enum { NoResult = ~0U };
+  enum LLVM_ENUM_INT_TYPE(unsigned) { NoResult = ~0U };
 
   static PseudoObjectExpr *Create(const ASTContext &Context, Expr *syntactic,
                                   ArrayRef<Expr*> semantic,

Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=192228&r1=192227&r2=192228&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Tue Oct  8 15:20:00 2013
@@ -89,7 +89,7 @@ class SourceLocation {
   friend class SourceManager;
   friend class ASTReader;
   friend class ASTWriter;
-  enum {
+  enum LLVM_ENUM_INT_TYPE(unsigned) {
     MacroIDBit = 1U << 31
   };
 public:





More information about the cfe-commits mailing list