This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug build/21773] binutils-gdb/gdb/common/vec.h:1085:31: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘btrace_insn_s {aka struct btrace_insn}’ from an array of ‘btrace_insn_s [1] {aka struct btrace_insn [1]}’ [-Werror=class-m


https://sourceware.org/bugzilla/show_bug.cgi?id=21773

Martin Sebor <msebor at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gmail dot com

--- Comment #1 from Martin Sebor <msebor at gmail dot com> ---
The errors were discussed on gcc-patches, along with a trivial patch for them:
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00299.html

The solution might need to be guarded if GDB is meant to compile with C++ 98
compiler.  Like so:

index ddfcddf..f344c4b 100644
--- a/gdb/common/enum-flags.h
+++ b/gdb/common/enum-flags.h
@@ -116,9 +116,13 @@ private:

 public:
   /* Allow default construction.  */
+#if __cplusplus >= 201103L
+  enum_flags () = default;
+#else
   enum_flags ()
     : m_enum_value ((enum_type) 0)
   {}
+#endif

   /* If you get an error saying these two overloads are ambiguous,
      then you tried to mix values of different enum types.  */

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]