Hello,
That is know issue and it comes from clangd, it has nothing together with an error in code and it will be compiled without issues around it.
With Mbed Studio and Keil Studio it is little bit complicated. Shortly say, both are still in development, from my point of view.
It is not official information, but my understanding. Development of Mbed Studio was stopped and it is waiting for a final look of Keil Studio online because it should be also Keil Studio desktop.
Keil Studio online development is still ongoing and there is good progress during the last year. it’s not that fast but it’s happening.
What I saw here, professionals usually use Mbed CLI.
BR, Jan