You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At some point in the future, we will most likely want to switch from
C++17 to C++20. Prepare the codebase for this, by rewriting it to be
valid for both C++17 and C++20.
Details:
================
All member functions Foo::operator==(const Foo&) must be const.
Otherwise Clang will complain:
ISO C++20 considers use of overloaded operator '==' ....
to be ambiguous despite there being a unique best viable function
[-Werror,-Wambiguous-reversed-operator]
================
ICU cannot be built with -std=c++20
It has a homegrown type
typedef int8_t UBool;
and there are plenty of warnings like: return type of virtual
UBool icu_69::TimeArrayTimeZoneRule::operator==(const icu_69::TimeZoneRule&)
const is not bool
and there is no warning to disable, operator==() *must* return bool.
The solution is to downgrade to -std=c++17 when building ICU.
================
Several warnings of the type:
increment of object of volatile-qualified type 'volatile int32'
(aka 'volatile int') is deprecated [-Werror,-Wdeprecated-volatile]
or alternatively volatile-qualified type is deprecated [-Werror=volatile]
Most of these volatile variables should be converted to std::atomic<>
but some cannot, if they are members of classes which need copy
construction, or copy assignment.
================
Both clang and gcc say:
pfs_example_continent.cc:273:50: error: no match for
operator= (operand types are PFS_engine_table_proxy and
<brace-enclosed initializer list>)
The solution is to remove the default CTOR of PFS_engine_table_proxy.
================
scheduler_imp.cc:420:49: error: memory_order_acquire is not a member
of std::memory_order
================
Template arguments should not be repeated in CTORs/DTORs
error: expected unqualified-id before ) token
287 | Lockless_hash<T>();
================
package <utility> for gcc12, which an in_range() function.
The macro is unused, so just remove it.
================
clang complains:
router/src/harness/include/mysql/harness/net_ts/executor.h:173:46:
error: member access into incomplete type
'net::execution_context::service
The solution is to move the implementation of a couple of member
functions later in the same source file.
================
error: no matching function for call to object of type
'(lambda at router/src/http/tests/test_passwd.cc:100:19)
router/src/http/tests/test_passwd.cc:100:19: note:
candidate function not viable: expects an lvalue for 1st argument
================
in sql/auth/sql_authorization.cc
move some 'bool operator==()' functions up so they are visible when we do
find(granted_roles.begin(), granted_roles.end(), role_id)
================
sql/field.cc:5570:22: warning: comparison of floating-point type double
with enumeration type Field_year::Limits is deprecated
[-Wdeprecated-enum-float-conversion]
Add explicit static_cast.
================
log_event.cc
make slave_skip_counter std::atomic
implicit capture of 'this' via [=] is deprecated in C++20 [-Wdeprecated]
Make an explicit list of captured variables instead.
================
sql_bitmap.h
do not repeat template parameters in CTOR/DTOR
================
sql_lex.h
sql/sql_lex.h:2860:45: error:
arithmetic between different enumeration types
('Query_tables_list::enum_binlog_stmt_unsafe' and
'Query_tables_list::enum_binlog_stmt_type')
is deprecated [-Werror,-Wdeprecated-enum-enum-conversion]
================
Misc places in storage/innobase
implicit capture of 'this' via [=] is deprecated in C++20 [-Wdeprecated]
================
gcc12 complains about
test_net_ts_timer.cc:144:36:
error: redefinition of 'template<class CharT, class Traits, class Rep,
class Period> std::basic_ostream<_CharT, _Traits>&
std::chrono::operator<<(std::basic_ostream<_CharT, _Traits>&, const
duration<_Rep2, _Period2>&)'
The fix is to change the feature test.
================
clang on loki09:
plugin/data_masking/datamask.cc:27:13:
error: instantiation of variable
'datamasking::Generator<std::basic_string<char>>::REGISTRY'
required here, but no definition is available [-Werror,-Wundefined-var-template]
switch (REGISTRY.has(token.get_blacklist(), ctx.m_in)) {
the fix is to move implementation of
Generator<T>::generate(const Dictionary_token<T> &token, Context<T> &ctx)
to plugin/data_masking/udf/functions.cc
================
clang 13/14 on Linux:
sql/log_event.cc:7964:15: error: explicit capture of 'this' with a capture default of '=' is a C++20 extension [-Werror,-Wc++20-extensions]
[=, this](TABLE const *table, size_t column_index) -> bool
================
strings_strnxfrm-t.cc
error: invalid conversion from const char8_t* to const char*
Change-Id: I51c24560bb72c071996fc2f4d85c5506fac523b5
0 commit comments