Variables declared with lambda captures with initializers are not syntax-highlighted and are not part of code completion inside of the lambda. [socket = std::weak_ptr<ISocket>(socketptr)]() { // "socket" is not available for code completion and when used the entire expression is not syntax-highlighted }; Same applies to variables defined by structured binding. I have the C++ profile set to C++1z in project settings and other C++14/17 constructs are highlighted correctly.
Created attachment 115585 [details] Highligted operator== with two unhighlighted variables As with lambda capture, structured binding seems to behave as if the type of the variable is indeed recognized, but not the declaration. I added a screenshot that demonstrates that two unhighlighted variables (created from structured bindings) actually yield to highlighted expressions when it uses other entities. I analyzed what libclang output as information, and it seems to skip declaration of such variable (structured bindings and lambda capture with initializers) but later uses those as if they were declared. This breaks the KDevelop DUChain, since the usages cannot be linked to a declaration.
lambda captures with initializers got merged a while ago: https://reviews.llvm.org/D60672 the c++17 stuff I added just now upstream: structured binding: https://reviews.llvm.org/D78213 if with init: https://reviews.llvm.org/D78214