iwyu adding cxxabi.h for __forced_unwind

436 Views Asked by At

I'm running iwyu over my code base, and there are a few files where it insists I add

#include <cxxabi.h>  // for __forced_unwind

I was able to ablate code and find that it seems related to cv.wait(mu).

Specifically, the no predicate version.

If I remove cv.wait(mu), iwyu no longer suggests cxxabi.h.

What is this __forced_unwind function, why is iwyu recommending it, and can this safely be ignored?

Minimal test case:

// foo.cpp

#include <condition_variable>
#include <mutex>

void foo(std::condition_variable_any* cv, std::mutex* mu) {
  cv->wait(*mu);
}
src/foo.cpp should add these lines:
#include <cxxabi.h>            // for __forced_unwind

src/foo.cpp should remove these lines:

The full include-list for src/foo.cpp:
#include <cxxabi.h>            // for __forced_unwind
#include <condition_variable>  // for condition_variable_any
#include <mutex>               // for mutex
---
0

There are 0 best solutions below