Commit ece078b8 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'clang_warnings'

0130088b Suppress more self-assign-overloaded warnings found by clang
fa545585 UnitTestArrayPortalValueReference doesn't warn when compiled with appleclang
5cc0d03f Merge branch 'upstream-diy' into clang_warnings
dbd3781d diy 2019-04-09 (f7a68da4)
5c2f2ebc suppress warnings found by Wself-assign-overloaded
77426f04 Correct casting long to long long warning from clang.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1635
parents e7b26f5c 0130088b
...@@ -224,10 +224,11 @@ void StorageBasicBase::AllocateValues(vtkm::Id numberOfValues, vtkm::UInt64 size ...@@ -224,10 +224,11 @@ void StorageBasicBase::AllocateValues(vtkm::Id numberOfValues, vtkm::UInt64 size
vtkm::cont::GetSizeString(allocsize).c_str()); vtkm::cont::GetSizeString(allocsize).c_str());
throw vtkm::cont::ErrorBadAllocation("Could not allocate basic control array."); throw vtkm::cont::ErrorBadAllocation("Could not allocate basic control array.");
} }
VTKM_LOG_F(vtkm::cont::LogLevel::MemCont, VTKM_LOG_S(vtkm::cont::LogLevel::MemCont,
"Allocated control array of %s. [element count %llu]", "Allocated control array of " << vtkm::cont::GetSizeString(allocsize).c_str()
vtkm::cont::GetSizeString(allocsize).c_str(), << ". [element count "
static_cast<std::int64_t>(numberOfValues)); << static_cast<std::int64_t>(numberOfValues)
<< "]");
} }
else else
{ {
......
...@@ -129,7 +129,8 @@ void TryOperatorsInt(vtkm::Id index, ...@@ -129,7 +129,8 @@ void TryOperatorsInt(vtkm::Id index,
#if defined(VTKM_CLANG) && __clang_major__ >= 7 #if defined(VTKM_CLANG) && __clang_major__ >= 7
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcovered-switch-default" #pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif #endif
ref &= ref; ref &= ref;
...@@ -216,6 +217,13 @@ void TryOperators(vtkm::Id index, vtkm::internal::ArrayPortalValueReference<Arra ...@@ -216,6 +217,13 @@ void TryOperators(vtkm::Id index, vtkm::internal::ArrayPortalValueReference<Arra
VTKM_TEST_ASSERT((ref / expected) == (expected / expected)); VTKM_TEST_ASSERT((ref / expected) == (expected / expected));
VTKM_TEST_ASSERT((expected / ref) == (expected / expected)); VTKM_TEST_ASSERT((expected / ref) == (expected / expected));
#if defined(VTKM_CLANG) && __clang_major__ >= 7
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif
ref += ref; ref += ref;
expected += expected; expected += expected;
VTKM_TEST_ASSERT(ref == expected); VTKM_TEST_ASSERT(ref == expected);
...@@ -244,6 +252,10 @@ void TryOperators(vtkm::Id index, vtkm::internal::ArrayPortalValueReference<Arra ...@@ -244,6 +252,10 @@ void TryOperators(vtkm::Id index, vtkm::internal::ArrayPortalValueReference<Arra
expected /= operand; expected /= operand;
VTKM_TEST_ASSERT(ref == expected); VTKM_TEST_ASSERT(ref == expected);
#if defined(VTKM_CLANG) && __clang_major__ >= 7
#pragma clang diagnostic pop
#endif
// Reset ref // Reset ref
ref = TestValue(index, ValueType()); ref = TestValue(index, ValueType());
......
...@@ -20,8 +20,8 @@ namespace internal { ...@@ -20,8 +20,8 @@ namespace internal {
template <class Char> template <class Char>
class FormatBuf : public std::basic_streambuf<Char> { class FormatBuf : public std::basic_streambuf<Char> {
private: private:
using int_type = typename std::basic_streambuf<Char>::int_type; typedef typename std::basic_streambuf<Char>::int_type int_type;
using traits_type = typename std::basic_streambuf<Char>::traits_type; typedef typename std::basic_streambuf<Char>::traits_type traits_type;
Buffer<Char> &buffer_; Buffer<Char> &buffer_;
...@@ -81,7 +81,7 @@ void format_arg(BasicFormatter<Char, ArgFormatter_> &f, ...@@ -81,7 +81,7 @@ void format_arg(BasicFormatter<Char, ArgFormatter_> &f,
output << value; output << value;
BasicStringRef<Char> str(&buffer[0], buffer.size()); BasicStringRef<Char> str(&buffer[0], buffer.size());
using MakeArg = internal::MakeArg< BasicFormatter<Char> >; typedef internal::MakeArg< BasicFormatter<Char> > MakeArg;
format_str = f.format(format_str, MakeArg(str)); format_str = f.format(format_str, MakeArg(str));
} }
......
...@@ -222,6 +222,6 @@ duplicate(const communicator& other) ...@@ -222,6 +222,6 @@ duplicate(const communicator& other)
#ifndef VTKM_DIY_NO_MPI #ifndef VTKM_DIY_NO_MPI
MPI_Comm newcomm; MPI_Comm newcomm;
MPI_Comm_dup(other.comm_, &newcomm); MPI_Comm_dup(other.comm_, &newcomm);
(*this) = std::move(communicator(newcomm,true)); (*this) = communicator(newcomm,true);
#endif #endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment