[PATCH] D22798: Fix for compiling with clang <= 3.7 and g++6 headers.

Frederich Munch via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 25 23:00:59 PDT 2016


marsupial created this revision.
marsupial added a reviewer: vsk.
marsupial added a subscriber: cfe-commits.
marsupial set the repository for this revision to rL LLVM.

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.

Repository:
  rL LLVM

https://reviews.llvm.org/D22798

Files:
  lib/Driver/Tools.cpp

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -3715,13 +3715,13 @@
     // 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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22798.65476.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160726/47009ea2/attachment.bin>


More information about the cfe-commits mailing list