cxx/.clang-tidy
David Tolnay f72b0c6182
Suppress modernize-use-equals-default
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;
          |     ^~~~~
2020-12-10 19:54:22 -08:00

20 lines
673 B
YAML

Checks:
# TODO: many of these need to be resolved.
# https://github.com/dtolnay/cxx/issues/500
clang-analyzer-*,
clang-diagnostic-*,
cppcoreguidelines-*,
modernize-*,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-special-member-functions,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-trailing-return-type,
HeaderFilterRegex: cxx\.h