Commit Graph

12 Commits

Author SHA1 Message Date
David Tolnay
395e20f64c
Suppress cppcoreguidelines-pro-type-varargs lint from clang-tidy
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];
      ^
2021-03-24 15:48:47 -04:00
David Tolnay
4be66f9ec8
Remove .clang-tidy link to issue #500
The issue has been closed and we are probably keeping the remaining set
of suppressions.
2021-03-24 15:47:29 -04:00
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
David Tolnay
ff7f5fb8cc
Add String and Str iterators 2020-11-25 21:06:33 -08:00
David Tolnay
2714d2c98f
Resolve modernize-use-override
https://github.com/dtolnay/cxx/issues/500
2020-11-23 18:17:45 -08:00
David Tolnay
79076c7b71
Resolve modernize-use-equals-default
https://github.com/dtolnay/cxx/issues/500
2020-11-23 18:17:01 -08:00
David Tolnay
06677b3e00
Resolve cppcoreguidelines-avoid-magic-numbers
https://github.com/dtolnay/cxx/issues/500
2020-11-23 18:07:52 -08:00
David Tolnay
16bcd38cb9
Link to clang-tidy lint tracking issue 2020-11-23 18:01:39 -08:00
David Tolnay
1c70aca761
Suppress all currently triggered clang-tidy checks 2020-11-23 17:40:44 -08:00
David Tolnay
83bb58ce27
Split clang-tidy config to one check/group per line 2020-11-23 17:40:44 -08:00
David Tolnay
6f2a126c86
Move header filter to clang-tidy config file 2020-11-23 17:40:42 -08:00
Iulian Radu
841c751764 Add clang-tidy CI check 2020-11-18 23:28:02 +02:00