]> granicus.if.org Git - clang/commitdiff
Fix a -Wmicrosoft warning about an unrepresentable enum value
authorReid Kleckner <reid@kleckner.net>
Mon, 3 Feb 2014 22:20:34 +0000 (22:20 +0000)
committerReid Kleckner <reid@kleckner.net>
Mon, 3 Feb 2014 22:20:34 +0000 (22:20 +0000)
In MSVC, enums are always signed unless you explicitly specify the type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200719 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaAttr.cpp

index 0214ba456c7e3899e189beaf0dab404f5b466476..499f958744741d2995a6b85ff332177c4183c6fd 100644 (file)
@@ -327,7 +327,7 @@ void Sema::AddCFAuditedAttribute(Decl *D) {
 }
 
 typedef std::vector<std::pair<unsigned, SourceLocation> > VisStack;
-enum { NoVisibility = (unsigned) -1 };
+enum LLVM_ENUM_INT_TYPE(unsigned) { NoVisibility = ~0U };
 
 void Sema::AddPushedVisibilityAttribute(Decl *D) {
   if (!VisContext)