[Lldb-commits] [lldb] c1e6f1a - [lldb] Fix gcc 5.4.0 compile error

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 27 02:23:12 PDT 2020


Author: David Spickett
Date: 2020-08-27T10:23:05+01:00
New Revision: c1e6f1a7b1a8cb2bb11a76b904c6f8150bfcc3a6

URL: https://github.com/llvm/llvm-project/commit/c1e6f1a7b1a8cb2bb11a76b904c6f8150bfcc3a6
DIFF: https://github.com/llvm/llvm-project/commit/c1e6f1a7b1a8cb2bb11a76b904c6f8150bfcc3a6.diff

LOG: [lldb] Fix gcc 5.4.0 compile error

Specify type when constructing PromotionKeys,
this fixes error:
"chosen constructor is explicit in copy-initialization"
when compiling lldb with GCC 5.4.0.

This is due to std::tuple having an explicit
default constructor, see:
http://cplusplus.github.io/LWG/lwg-defects.html#2193

Reviewed By: labath

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

Added: 
    

Modified: 
    lldb/source/Utility/Scalar.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Utility/Scalar.cpp b/lldb/source/Utility/Scalar.cpp
index e5a1454561f2..3249ba5a02e3 100644
--- a/lldb/source/Utility/Scalar.cpp
+++ b/lldb/source/Utility/Scalar.cpp
@@ -55,9 +55,9 @@ Scalar::PromotionKey Scalar::GetPromoKey() const {
   Category cat = GetCategory(m_type);
   switch (cat) {
   case Category::Void:
-    return {cat, 0, false};
+    return PromotionKey{cat, 0, false};
   case Category::Integral:
-    return {cat, m_integer.getBitWidth(), !IsSigned(m_type)};
+    return PromotionKey{cat, m_integer.getBitWidth(), !IsSigned(m_type)};
   case Category::Float:
     return GetFloatPromoKey(m_float.getSemantics());
   }
@@ -70,7 +70,7 @@ Scalar::PromotionKey Scalar::GetFloatPromoKey(const llvm::fltSemantics &sem) {
       &APFloat::x87DoubleExtended()};
   for (const auto &entry : llvm::enumerate(order)) {
     if (entry.value() == &sem)
-      return {Category::Float, entry.index(), false};
+      return PromotionKey{Category::Float, entry.index(), false};
   }
   llvm_unreachable("Unsupported semantics!");
 }


        


More information about the lldb-commits mailing list