Strange clangd errors in Qt Creator
I am developing a project using MinGW and qmake with Qt Creator IDE. For some time I have been receiving strange and completely baseless clangd warnings in the QT Creator editor, but the code still compiles correctly. I created a new project to check if I would receive similar warnings and the newly created project works properly without errors. What could I have done wrong in my project that I am getting these errors and how can I fix it? Below are some warnings and a fragment of the .pro file.
.pro file fragment:
Code:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++20
CONFIG += qwt
CONFIG += staticlib
CONFIG += static-libgcc
CONFIG += static-libstdc++
CONFIG += disable-desktop
CONFIG += qtquickcompiler
Some Qt components include are getting errors, e.g. this:
is generating this error:
Code:
In included file: unexpected type name 'size_t': expected expression
Also the range based C++11 for loops are generating errors:
Code:
for (auto button : buttonGroup_alphabetic.buttons()) {
button->setText(button->text().toUpper());
}
error:
Code:
Expected '(' for function-style cast or type construction