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
vtkm::cont::GetSizeString(allocsize).c_str());
throw vtkm::cont::ErrorBadAllocation("Could not allocate basic control array.");
}
VTKM_LOG_F(vtkm::cont::LogLevel::MemCont,
"Allocated control array of %s. [element count %llu]",
vtkm::cont::GetSizeString(allocsize).c_str(),
static_cast<std::int64_t>(numberOfValues));
VTKM_LOG_S(vtkm::cont::LogLevel::MemCont,
"Allocated control array of " << vtkm::cont::GetSizeString(allocsize).c_str()
<< ". [element count "
<< static_cast<std::int64_t>(numberOfValues)
<< "]");
}
else
{
......
......@@ -129,7 +129,8 @@ void TryOperatorsInt(vtkm::Id index,
#if defined(VTKM_CLANG) && __clang_major__ >= 7
#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
ref &= ref;
......@@ -216,6 +217,13 @@ void TryOperators(vtkm::Id index, vtkm::internal::ArrayPortalValueReference<Arra
VTKM_TEST_ASSERT((ref / expected) == (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;
expected += expected;
VTKM_TEST_ASSERT(ref == expected);
......@@ -244,6 +252,10 @@ void TryOperators(vtkm::Id index, vtkm::internal::ArrayPortalValueReference<Arra
expected /= operand;
VTKM_TEST_ASSERT(ref == expected);
#if defined(VTKM_CLANG) && __clang_major__ >= 7
#pragma clang diagnostic pop
#endif
// Reset ref
ref = TestValue(index, ValueType());
......
......@@ -20,8 +20,8 @@ namespace internal {
template <class Char>
class FormatBuf : public std::basic_streambuf<Char> {
private:
using int_type = typename std::basic_streambuf<Char>::int_type;
using traits_type = typename std::basic_streambuf<Char>::traits_type;
typedef typename std::basic_streambuf<Char>::int_type int_type;
typedef typename std::basic_streambuf<Char>::traits_type traits_type;
Buffer<Char> &buffer_;
......@@ -81,7 +81,7 @@ void format_arg(BasicFormatter<Char, ArgFormatter_> &f,
output << value;
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));
}
......
......@@ -222,6 +222,6 @@ duplicate(const communicator& other)
#ifndef VTKM_DIY_NO_MPI
MPI_Comm newcomm;
MPI_Comm_dup(other.comm_, &newcomm);
(*this) = std::move(communicator(newcomm,true));
(*this) = communicator(newcomm,true);
#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