[Lldb-commits] [PATCH] D86690: [lldb] Fix gcc 5.4.0 compile error

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 27 01:54:42 PDT 2020


DavidSpickett created this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
DavidSpickett requested review of this revision.
Herald added a subscriber: JDevlieghere.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86690

Files:
  lldb/source/Utility/Scalar.cpp


Index: lldb/source/Utility/Scalar.cpp
===================================================================
--- lldb/source/Utility/Scalar.cpp
+++ lldb/source/Utility/Scalar.cpp
@@ -55,9 +55,9 @@
   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 @@
       &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!");
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86690.288232.patch
Type: text/x-patch
Size: 915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200827/fdb952b2/attachment.bin>


More information about the lldb-commits mailing list