Explicitly request unsigned enum types when desired
authorReid Kleckner <reid@kleckner.net>
Tue, 8 Oct 2013 20:20:00 +0000 (20:20 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 8 Oct 2013 20:20:00 +0000 (20:20 +0000)
This fixes repeated -Wmicrosoft warnings when self-hosting clang on
Windows, and gets us real unsigned enum types with MSVC.

llvm-svn: 192228

clang/include/clang/AST/Comment.h
clang/include/clang/AST/Expr.h
clang/include/clang/Basic/SourceLocation.h

index ac3eaff..28849f5 100644 (file)
@@ -699,7 +699,7 @@ private:
   unsigned ParamIndex;
 
 public:
-  enum {
+  enum LLVM_ENUM_INT_TYPE(unsigned) {
     InvalidParamIndex = ~0U,
     VarArgParamIndex = ~0U/*InvalidParamIndex*/ - 1U
   };
index a53b88d..9c8ad69 100644 (file)
@@ -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,
index 143beb6..10ae07b 100644 (file)
@@ -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: