]> granicus.if.org Git - clang/commitdiff
Fix for compiling with clang <= 3.7 and g++6 headers
authorVedant Kumar <vsk@apple.com>
Wed, 27 Jul 2016 03:43:34 +0000 (03:43 +0000)
committerVedant Kumar <vsk@apple.com>
Wed, 27 Jul 2016 03:43:34 +0000 (03:43 +0000)
Make integers explicitly unsigned, so the tuple constructor will resolve
properly when but with clang 3.6, 3.7 and gcc 6.1.1 libstdc++ headers.

Patch by Frederich Munch!

Differential Revision: https://reviews.llvm.org/D22798

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

lib/Driver/Tools.cpp

index 4038f0f5df436f6b26ffab8414317b9fcdf2a9b8..e747149679cd406d99320e852af10e04790e39cb 100644 (file)
@@ -3819,13 +3819,13 @@ ParsePICArgs(const ToolChain &ToolChain, const llvm::Triple &Triple,
     // match that of llvm-gcc and Apple GCC before that.
     PIC = ToolChain.isPICDefault() && ToolChain.isPICDefaultForced();
 
-    return std::make_tuple(llvm::Reloc::DynamicNoPIC, PIC ? 2 : 0, false);
+    return std::make_tuple(llvm::Reloc::DynamicNoPIC, PIC ? 2U : 0U, false);
   }
 
   if (PIC)
-    return std::make_tuple(llvm::Reloc::PIC_, IsPICLevelTwo ? 2 : 1, PIE);
+    return std::make_tuple(llvm::Reloc::PIC_, IsPICLevelTwo ? 2U : 1U, PIE);
 
-  return std::make_tuple(llvm::Reloc::Static, 0, false);
+  return std::make_tuple(llvm::Reloc::Static, 0U, false);
 }
 
 static const char *RelocationModelName(llvm::Reloc::Model Model) {