Skip to content

add missing include directives for compiling with Clang 23 - #43027

Merged
vbraun merged 1 commit into
sagemath:developfrom
dcoudert:add_missing_include_directives
Oct 22, 2026
Merged

vbraun merged 1 commit into
sagemath:developfrom
dcoudert:add_missing_include_directives

Conversation

@dcoudert

Copy link
Copy Markdown
Collaborator

This is a back port of passagemath/passagemath#2961 that adds missing #include <iterator> directives to fix compilation errors with Clang 23.
Both std::back_inserter and std::insert_iterator are part of iterator.

MAC-xxxxx:sage dcoudert$ git grep "insert_iterator" src/
src/sage/geometry/triangulation/data.cc:      std::insert_iterator<vertices>
src/sage/graphs/base/boost_interface.cpp:        std::back_insert_iterator<edge_container> inserter(disconnecting_set);
MAC-xxxxx:sage dcoudert$ git grep "back_inserter" src/
src/sage/geometry/triangulation/data.cc:  copy(s.begin(), s.end(), back_inserter(v) );
src/sage/graphs/base/boost_interface.cpp:        kruskal_minimum_spanning_tree(graph, std::back_inserter(spanning_tree));
src/sage/graphs/graph_decompositions/modular_decomposition.hpp:            std::fill_n(std::back_inserter(scratch.Left), j-j0, lp);
src/sage/symbolic/ginac/ex_utils.h:{ std::transform(pv.begin(), pv.end(), std::back_inserter(v),
src/sage/symbolic/ginac/ex_utils.h:{ std::transform(pv.begin(), pv.end(), std::back_inserter(v),

We add the missing include directive in data.cc, boost_interface.cpp and modular_decomposition.hpp.

This is not needed for src/sage/symbolic/ginac/ex_utils.h which includes src/sage/symbolic/ginac/ex.h which already contains #include <iterator>.

On the way we fix 2 compilation warnings in src/sage/geometry/triangulation/data.cc

[sagelib-11.0.beta3] [spkg-install]   ../../src/sage/geometry/triangulation/data.cc:111:10: warning: variable 'i' set but not used [-Wunused-but-set-variable]
[sagelib-11.0.beta3] [spkg-install]     111 |   vertex i,j,l=0,k;
[sagelib-11.0.beta3] [spkg-install]         |          ^
[sagelib-11.0.beta3] [spkg-install]   ../../src/sage/geometry/triangulation/data.cc:111:12: warning: variable 'j' set but not used [-Wunused-but-set-variable]
[sagelib-11.0.beta3] [spkg-install]     111 |   vertex i,j,l=0,k;
[sagelib-11.0.beta3] [spkg-install]         |            ^
[sagelib-11.0.beta3] [spkg-install]   2 warnings generated.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@dcoudert dcoudert self-assigned this Oct 20, 2026
@dcoudert
dcoudert requested a review from cxzhong October 20, 2026 13:44
@striezel

Copy link
Copy Markdown
Contributor

Thanks for backporting those changes to Sage. :) That saved me the work of opening another pull request. :D

@dcoudert

Copy link
Copy Markdown
Collaborator Author

Thanks. I'm adding label "positive review" on your behalf.

@github-actions

Copy link
Copy Markdown

Documentation preview for this PR (built with commit 8cb016a; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@vbraun
vbraun merged commit 9d619c9 into sagemath:develop Oct 22, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants