ccls
ccls copied to clipboard
Emacs -ccls no member named 'variant' in namespace 'std'
Observed behavior
Every time I try to access some std libraries I get the following error: no member named 'x' in namespace 'std'
for example:
#include <iostream>
#include <variant>
int main() {
std::variant<std::string, int> s;
}
another example
#include <iostream>
#include <filesystem>
int main(int argc, char** argv) {
std::filesystem::path filePath("./sample.cpp");
std::cout << filePath.filename() << std::endl;
return 0;
}
no member named 'filesystem' in namespace 'std'.
I also get the following error: LSP :: Error from the Language Server: not indexed (Invalid Request) as mentioned in #874
I have tried many .ccls configurations, but none of them worked, example:
clang++
%c -std=c11
%cpp -std=c++17
also tried with clang, g++.
System information
- ccls version:
<unknown>? - clang version:
λ clang --version
clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
g++ (GCC) 12.2.0
- OS: Latest Arch Linux with lts kernel:
Linux 5.15.62-1-lts
Ok, I don't know why, but I noticed this issue happens when I install ccls. When I removed it everything works fine. But now I guess my client is using c++17 only, I can't change to C++20 with .ccls but It's possible with compile_commands.json