]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add constructor to stap_static_probe_ops
authorTom Tromey <tromey@adacore.com>
Thu, 19 Dec 2019 18:35:22 +0000 (11:35 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 7 Jan 2020 16:46:26 +0000 (09:46 -0700)
PR build/24937 concerns an error given by the clang provided by a
particular version of macOS.  In particular, it reports

    error: default initialization of an object of const type 'const
    stap_static_probe_ops' without a user-provided default constructor

Although (at least according to sources I found online) this was
resolved as a bug in the standard, it seemed simple enough to work
around this.

Given that this is a trivial build fix, I think it should go on the
gdb 9 branch as well.

2020-01-07  Tom Tromey  <tromey@adacore.com>

PR build/24937:
* stap-probe.c (class stap_static_probe_ops): Add constructor.

Change-Id: I18f180c17850f420e9b66afc67f9cb3d8dceb0b3

gdb/ChangeLog
gdb/stap-probe.c

index 37b0a773434037b650b665253e5b34e4f3c9a51c..4ce7ef447fa36ca80b993f4a936406277aa0b451 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-07  Tom Tromey  <tromey@adacore.com>
+
+       PR build/24937:
+       * stap-probe.c (class stap_static_probe_ops): Add constructor.
+
 2020-01-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * stack.c (print_frame_info): Move disassemble_next_line code
index 806725c75e68383e731c2abf87f0c7ef747ca83e..39da2900e7af30d0c24702019c8b835038b0b646 100644 (file)
@@ -101,6 +101,12 @@ struct stap_probe_arg
 class stap_static_probe_ops : public static_probe_ops
 {
 public:
+  /* We need a user-provided constructor to placate some compilers.
+     See PR build/24937.  */
+  stap_static_probe_ops ()
+  {
+  }
+
   /* See probe.h.  */
   bool is_linespec (const char **linespecp) const override;