gcc fails to build while MSVC succeeded: unsigned specified with typeof

19 hours ago 2
ARTICLE AD BOX

Is there a reason why gcc 13.2.1 on Linux gives the error below, while MSVC 2017 builds just fine?

bool SQLiteDatabase::CompareNoCase(const std::wstring &a, const std::wstring &b) { return std::equal( a.begin(), a.end(), b.begin(), [](wchar_t ch1, wchar_t ch2) { return std::toupper( static_cast<unsigned wchar_t>( ch1 ) ) == std::toupper( static_cast<unsigned wchar_t>( ch2 ) ); } ); }

Error reported is:

../../libsqlite/database_sqlite.cpp: In lambda function: ../../libsqlite/database_sqlite.cpp:3224:42: error: 'unsigned' specified with 'typeof' 3224 | return std::toupper( static_cast<unsigned wchar_t>( ch1 ) ) == std::toupper( static_cast<unsigned wchar_t>( ch2 ) ); | ^~~~~~~~
Read Entire Article