On Fri, 2021-02-26 at 10:24 +0100, Andreas Schwab wrote:
> I'm getting this link failure for all compilers:
> 
> analyzer/diagnostic-manager.o: In function
> `ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
> const&)':
> diagnostic-manager.cc:(.text+0xd350): undefined reference to
> `ana::exploded_path::exploded_path(ana::exploded_path const&)'
> 
> Andreas.

Sorry about the breakage.

What compiler are you using?
I'm not seeing this (with gcc 4.8.5, or gcc 10.2.1).

Does the following patch fix the build for you?

gcc/analyzer/ChangeLog:
        * engine.cc (exploded_path::exploded_path): New copy-ctor.
        * exploded-graph.h (exploded_path::operator=): Drop decl.
---
 gcc/analyzer/engine.cc        | 9 +++++++++
 gcc/analyzer/exploded-graph.h | 1 -
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 7580f0ba57a..76e2069c935 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3411,6 +3411,15 @@ exploded_graph::to_json () const
   return egraph_obj;
 }
 
+exploded_path::exploded_path (const exploded_path &other)
+: m_edges (other.m_edges.length ())
+{
+  int i;
+  const exploded_edge *eedge;
+  FOR_EACH_VEC_ELT (other.m_edges, i, eedge)
+    m_edges.quick_push (eedge);
+}
+
 /* Look for the last use of SEARCH_STMT within this path.
    If found write the edge's index to *OUT_IDX and return true, otherwise
    return false.  */
diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h
index 45943093434..bcf58557de2 100644
--- a/gcc/analyzer/exploded-graph.h
+++ b/gcc/analyzer/exploded-graph.h
@@ -867,7 +867,6 @@ class exploded_path
 public:
   exploded_path () : m_edges () {}
   exploded_path (const exploded_path &other);
-  exploded_path & operator= (const exploded_path &other);
 
   unsigned length () const { return m_edges.length (); }
 
-- 
2.26.2

Reply via email to