https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116143

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
For such a trivial method, why don't you just define it inline?
So
--- gcc/simple-diagnostic-path.h.jj     2025-01-02 11:23:37.876218670 +0100
+++ gcc/simple-diagnostic-path.h        2025-02-05 15:29:32.882855368 +0100
@@ -100,9 +100,9 @@ class simple_diagnostic_path : public di
  public:
   simple_diagnostic_path (pretty_printer *event_pp);

-  unsigned num_events () const final override;
+  unsigned num_events () const final override { return m_events.length (); }
   const diagnostic_event & get_event (int idx) const final override;
-  unsigned num_threads () const final override;
+  unsigned num_threads () const final override { return m_threads.length (); }
   const diagnostic_thread &
   get_thread (diagnostic_thread_id_t) const final override;
   bool
--- gcc/simple-diagnostic-path.cc.jj    2025-01-02 11:23:19.409476476 +0100
+++ gcc/simple-diagnostic-path.cc       2025-02-05 15:29:59.185492553 +0100
@@ -41,15 +41,6 @@ simple_diagnostic_path::simple_diagnosti
   add_thread ("main");
 }

-/* Implementation of diagnostic_path::num_events vfunc for
-   simple_diagnostic_path: simply get the number of events in the vec.  */
-
-unsigned
-simple_diagnostic_path::num_events () const
-{
-  return m_events.length ();
-}
-
 /* Implementation of diagnostic_path::get_event vfunc for
    simple_diagnostic_path: simply return the event in the vec.  */

@@ -59,12 +50,6 @@ simple_diagnostic_path::get_event (int i
   return *m_events[idx];
 }

-unsigned
-simple_diagnostic_path::num_threads () const
-{
-  return m_threads.length ();
-}
-
 const diagnostic_thread &
 simple_diagnostic_path::get_thread (diagnostic_thread_id_t idx) const
 {

?
  • [Bug testsuite/116143] [15 regr... jakub at gcc dot gnu.org via Gcc-bugs

Reply via email to