From ab0f18076b11972429e7d04cb818582f949f03b5 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 27 Mar 2019 10:02:36 +0000 Subject: [PATCH] Fix a "memset clearing an object of non-trivial type" warning in DWARFFormValue 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp index ce1683dcc55c..e809daa65f8a 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -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,