GCC 9 doesn't accept [[unlikely]] between the (condition) and the compound-statement of an if, in both C++17 and C++20 modes: qdecompresshelper.cpp: In member function ‘qsizetype QDecompressHelper::readZLib(char*, qsizetype)’: qcompilerdetection.h:1048:31: error: attributes at the beginning of statement are ignored [-Werror=attributes] 1048 | # define Q_UNLIKELY_BRANCH [[unlikely]] | ^~~~~~~~~~~~ qdecompresshelper.cpp:597:54: note: in expansion of macro ‘Q_UNLIKELY_BRANCH’ 597 | if (ret == Z_DATA_ERROR && !triedRawDeflate) Q_UNLIKELY_BRANCH { | ^~~~~~~~~~~~~~~~~ See also https://stackoverflow.com/questions/51797959/how-to-use-c20s-likely-unlikely-attribute-in-if-else-statement Put it into the compound-statement instead, then GCC 9 accepts it. The two are equivalent, because [[likely]] marks a path, and there is no selection statement between the two positions. Amends 5ae84d0afbd3690a2c003d06d920566a5d56dc8c. Change-Id: Iac1970219c98a1c26e450dfe6bad6583e4d32c29 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 7a7804d4b454021d68d1d5138d134ef62abfcdb3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%