Avoid warnings about mixing different enums with C++20

C++20 deprecates arithmetic operations with the elements of different
enums and at least clang 10 and MSVS 2019 already warn about this when
compiling in C++20 mode, so avoid such operations at least in the public
headers to avoid warnings in the applications using wxWidgets and C++20.
This commit is contained in:
Vadim Zeitlin
2021-04-24 19:05:11 +01:00
parent 31b983bad1
commit 5ab5172930
2 changed files with 3 additions and 2 deletions

View File

@@ -147,7 +147,8 @@ protected:
wxDEPRECATED_MSG("useless and will be removed in the future")
int GetDefaultTextCtrlFlag() const
{
return wxALIGN_CENTER_VERTICAL | wxRIGHT;
// Cast to avoid warnings about mixing elements of different enums.
return wxALIGN_CENTER_VERTICAL | static_cast<int>(wxRIGHT);
}
#endif // WXWIN_COMPATIBILITY_3_0