Fix a "memset clearing an object of non-trivial type" warning in DWARFFormValue
authorPavel Labath <pavel@labath.sk>
Wed, 27 Mar 2019 10:02:36 +0000 (10:02 +0000)
committerPavel Labath <pavel@labath.sk>
Wed, 27 Mar 2019 10:02:36 +0000 (10:02 +0000)
This is diagnosed by gcc-8. The ValueType struct already has a default
constructor which performs zero-initialization, so we can just call that
instead of using memset.

llvm-svn: 357056

lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp

index ce1683d..e809daa 100644 (file)
@@ -115,7 +115,7 @@ DWARFFormValue::DWARFFormValue(const DWARFUnit *cu, dw_form_t form)
 void DWARFFormValue::Clear() {
   m_cu = nullptr;
   m_form = 0;
-  memset(&m_value, 0, sizeof(m_value));
+  m_value = ValueTypeTag();
 }
 
 bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,