C++20 Non-type template parameter
已回答
I'm using C++2a and non type template parameters. The compilation/execution works fine.
But CLion highlights false errors. An example is given in the Image below.
I guess the error detection is somehow defined to use a pre C++2a version. How can I fix this issue ?
请先登录再写评论。
Is there information I can add to clarify this?
As it seems other Posts get answered.
I'm not asking for the c++2a Feature itself. I'm asking how to remove the wrong error messages.
I added a minimal reproducible example. Which compiles and runs correctly.

struct Example {
int val = 0;
};
template<Example e>
int func() {
return e.val;
}
int main() {
constexpr Example e{19};
return func<e>();
}
Hello!
It seems clangd (on which the CLion's second language engine is based) doesn't support this case yet. Unfortunately, it's not possible to disable this error at the moment, sorry for the inconvenience. Feel free to create a feature request about an opportunity to disable it in https://youtrack.jetbrains.com/issue/CPP.