because [[maybe unused]] doesn't work in Qt?
-
I get this warning, because I have cppcheck installed, and it tells me that I don't use the return value of qry, so I put the [[maybe_unused]] attribute, and it gives me an error, it should work, but it doesn't.
[[maybe_unused]]qry.prepare("SELECT from my db");
-
[[maybe_unused]]
is a c++ 17 feature - make sure to compile your code with c++17. So it's a basic c++ problem which has nothing to do with Qt. -
I get this warning, because I have cppcheck installed, and it tells me that I don't use the return value of qry, so I put the [[maybe_unused]] attribute, and it gives me an error, it should work, but it doesn't.
[[maybe_unused]]qry.prepare("SELECT from my db");
@lincoln It does work if you have set up your project correctly. I am using it within a Qt C++20 project without problems.