Description: Make IncrementalSubgraph::IterFCmp::operator() const for GCC 15
 std::set<decltype(frontier)::iterator, IterFCmp> hands its comparator to const
 member functions of std::_Rb_tree, for example when
 set::erase(const key_type&) looks the key up.  GCC 15's libstdc++ requires the
 comparison functor to be callable on a const object, so the build fails with
   /usr/include/c++/15/bits/stl_tree.h:2604:36: error: no match for call to
     '(const vg::IncrementalSubgraph::IterFCmp) (...)'
   src/incremental_subgraph.hpp:186:21: note: passing
     'const vg::IncrementalSubgraph::IterFCmp*' as 'this' argument discards
     qualifiers
 Mark the comparator const, like the frontier's own FCmp already is; it does
 not modify any state.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-09-16

--- vg-1.59.0+ds.orig/src/incremental_subgraph.hpp
+++ vg-1.59.0+ds/src/incremental_subgraph.hpp
@@ -183,8 +183,11 @@ private:
     /// wrapper for the comparator in the frontier index, which guarantees that the iterators
     /// end up in the same relative order in the frontier index as in the frontier
     struct IterFCmp {
+        // Note: this has to be const, because the set that uses it may compare
+        // keys from a const context (e.g. inside erase(const key_type&));
+        // GCC 15's libstdc++ enforces that.
         inline bool operator()(const decltype(frontier)::iterator& a,
-                               const decltype(frontier)::iterator& b) {
+                               const decltype(frontier)::iterator& b) const {
             return FCmp()(*a, *b);
         }
     };
