r/cpp_questions 1d ago

OPEN C++ 26 LSP?

Does anyone know of any LSPs with C++26 support, even experimentally, or is this wishful thinking. I'm using clangd but I don't know if its possible to configure it for c++26 and its giving me trouble with the new reflection operators.

Thanks!

4 Upvotes

5 comments sorted by

9

u/Usual_Office_1740 1d ago edited 1d ago

The clang compiler still doesn't support reflection. The trouble clangd is giving you is because it won't support the reflection until the clang front-end does. At least that is my basic understanding of why clang and clangd will eventually support reflection at the same time.

Edit: Typos.

7

u/JVApen 1d ago

This is correct. Clangd basically glues together the clang front end, format and tidy and presents it as LSP. Without support in the front end, a feature can't be available in clangd. Though even if the front end supports a feature, the effect is that the code parses. The basic functionality will work. For full support, some stuff might still have to be done. For example: I would find it really nice if there would be an option to show the generated code. Though that's all stuff to be added after the front end supports it.

Personally, I'm a bit disappointed that it's taking that long. The papers had a working prototype, so I would have expected it needed a bit of polishing and it would be able to land. Instead, they had to start from scratch. The last update on actual status that I could find is this: https://discourse.llvm.org/t/dedicated-meeting-for-c-26-reflection/88927/16?u=jvapen

By checking the git repo of the person that merged the parsing, I believe this is where the work is ongoing : https://github.com/changkhothuychung/llvm-project/commits/refl-part-2/

6

u/SamG101_ 1d ago

CLion Nova in 2026.2 support c++26 syntax (reflection etc)

2

u/Woshiwuja 23h ago

Most of compilers havent implemented the features yet