mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[Reland] [11/N] Enable clang-tidy warnings on c10/util/*.h (#116751)
Reland of #116353 with C++ diagnostic macros restored. Pull Request resolved: https://github.com/pytorch/pytorch/pull/116751 Approved by: https://github.com/albanD
This commit is contained in:
@ -125,6 +125,7 @@ class ArrayRef final {
|
||||
|
||||
/// Construct an ArrayRef from a C array.
|
||||
template <size_t N>
|
||||
// NOLINTNEXTLINE(*c-arrays*)
|
||||
/* implicit */ constexpr ArrayRef(const T (&Arr)[N]) : Data(Arr), Length(N) {}
|
||||
|
||||
/// Construct an ArrayRef from a std::initializer_list.
|
||||
@ -238,6 +239,7 @@ class ArrayRef final {
|
||||
/// continues to select the move assignment operator.
|
||||
template <typename U>
|
||||
std::enable_if_t<std::is_same_v<U, T>, ArrayRef<T>>& operator=(
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward)
|
||||
U&& Temporary) = delete;
|
||||
|
||||
/// Disallow accidental assignment from a temporary.
|
||||
@ -330,6 +332,7 @@ ArrayRef<T>& makeArrayRef(ArrayRef<T>& Vec) {
|
||||
|
||||
/// Construct an ArrayRef from a C array.
|
||||
template <typename T, size_t N>
|
||||
// NOLINTNEXTLINE(*c-arrays*)
|
||||
ArrayRef<T> makeArrayRef(const T (&Arr)[N]) {
|
||||
return ArrayRef<T>(Arr);
|
||||
}
|
||||
|
Reference in New Issue
Block a user