Closed
Description
Hi,
We are consistently getting the following false positive:
c.cpp:10:9: warning: std::max is defined in <algorithm>, which isn't directly #included.
Somehow this failure only happens when importing the nlohmann/json library
The following code reproduces the problem:
#include <vector>
#include <nlohmann/json.hpp>
class Foo
{
public:
void bar()
{
v.push_back(0.F); /// < IWYU warning emitted here!?
}
private:
std::vector<float> v;
};
void f()
{
nlohmann::json json;
Foo f;
}
This warning goes away if I remove the #include <nlohmann/json.hpp> line. Why is that the case? It doesn't make sense, there's no use of std::max in this .cpp file. There's not even such a use in the json.hpp library itself, which by the way includes the algorithm header.
I have tried increasing verbosity but I can't really understand where the problem comes from. Any ideas? How can I debug further?
Thanks!!
Metadata
Metadata
Assignees
Labels
No labels