Comment # 6 on bug 1199943 from
Thanks, Aaron, and sorry, I messed up when reducing the problem.

The confusing thing was that clangd defeated my sanity check
(-Iweird_include worked when -std=c++17 did not).

When reducing the problem again, it seems to be a header name collision between
newlib and host headers (cross compilation).

I thought I managed to minimize it down to a single header, sys/cdefs.h, but
when renaming the include directory (just as a sanity check), the problem
evaporated (as if clangd was stateful).

New reproducer (not reduced to a single header):

Install /usr/riscv64-elf/include

    zypper in cross-riscv64-newlib-devel

/tmp/compile_commands.json:

    [{
        "directory": "/tmp",
        "command": "clang++ -std=c++17 -isystem /usr/riscv64-elf/include -c
takes_string_view.cpp -o takes_string_view.o",
        "file": "takes_string_view.cpp"
    }]

/tmp/takes_string_view.cpp:

    #include <cstdlib> // Not relevant, but erases string_view.
    #include <string_view>

    void f(std::string_view str); // No member named 'string_view' in namespace
'std'


You are receiving this mail because: