I don't understand why this specific lint is triggering in the two cases below
but the code seems fine.
include/cxx.h:882:3: error: do not declare variables of type va_list; use variadic templates instead [cppcoreguidelines-pro-type-vararg,-warnings-as-errors]
auto data = reinterpret_cast<char *>(this->data());
^
src/cxx.cc:355:3: error: do not declare variables of type va_list; use variadic templates instead [cppcoreguidelines-pro-type-vararg,-warnings-as-errors]
char *copy = new char[len];
^
Clang-tidy emits this warning:
src/cxx.cc:338:3: warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]
MaybeUninit() {}
^ ~~
= default;
src/cxx.cc:339:3: warning: use '= default' to define a trivial destructor [modernize-use-equals-default]
~MaybeUninit() {}
^ ~~
= default;
but following the suggestion makes the code not compile (the default
implementation of the default constructor "is implicitly deleted because
the default definition would be ill-formed").
src/cxx.cc: In function ‘std::string* cxxbridge1$std$shared_ptr$string$uninit(std::shared_ptr<std::__cxx11::basic_string<char> >*)’:
src/cxx.cc:465:48: error: use of deleted function ‘rust::cxxbridge1::{anonymous}::MaybeUninit<T>::MaybeUninit() [with T = std::__cxx11::basic_string<char>]’
465 | reinterpret_cast<CXX_TYPE *>(new rust::MaybeUninit<CXX_TYPE>); \
| ^~~~~~~~~~~~~~~~~~~~~
src/cxx.cc:512:3: note: in expansion of macro ‘SHARED_PTR_OPS’
512 | MACRO(string, std::string)
| ^~~~~
src/cxx.cc:517:1: note: in expansion of macro ‘FOR_EACH_SHARED_PTR’
517 | FOR_EACH_SHARED_PTR(SHARED_PTR_OPS)
| ^~~~~~~~~~~~~~~~~~~
src/cxx.cc:338:3: note: ‘rust::cxxbridge1::{anonymous}::MaybeUninit<T>::MaybeUninit() [with T = std::__cxx11::basic_string<char>]’ is implicitly deleted because the default definition would be ill-formed:
338 | MaybeUninit() = default;
| ^~~~~~~~~~~
src/cxx.cc:337:5: error: union member ‘rust::cxxbridge1::{anonymous}::MaybeUninit<std::__cxx11::basic_string<char> >::value’ with non-trivial ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
337 | T value;
| ^~~~~