pytorch - 💡(How to fix) Fix Compile error: no matching function for call to 'erase' while using clang20

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

pytorch/torch/csrc/distributed/c10d/TCPStoreBackend.cpp:225:5: error: no matching function for call to 'erase'

RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

I encounter the problem that pytorch/torch/csrc/distributed/c10d/TCPStoreBackend.cpp:225:5: error: no matching function for call to 'erase' while using clang20 as compiler

std::erase(vec, value) is defined in the <vector> header in the C++20 standard. GCC's <unordered_map> used to include it indirectly, so the code compiled successfully. However, under clang-20, it is no longer exposed indirectly. Adding #include <vector> fixes the issue.

Should this header file to be include for supporting clang20 compilation working properly?

Versions

I'm using pytorch main nightly 0525 version.

cc @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta @msaroufim @dcci @aditvenk @weifengpy

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix Compile error: no matching function for call to 'erase' while using clang20