Примеры ошибок, обнаруженных с помощью диагностики V546
V546. The 'Foo(Foo)' class member is initialized with itself.
Boost (C++ libraries)
V546 Member of a class is initialized by itself: 'size1_(size1_)'. sparse_view.hpp 193
BOOST_UBLAS_INLINE
compressed_matrix_view(const compressed_matrix_view& o) :
size1_(size1_), size2_(size2_),
nnz_(nnz_),
index1_data_(index1_data_),
index2_data_(index2_data_),
value_data_(value_data_)
{}
Also: size2_, nnz_, index1_data_, index2_data_, value_data_.
OpenToonz
V546 Member of a class is initialized by itself: 'm_subId(m_subId)'. tfarmcontroller.cpp 572
class TaskId
{
int m_id;
int m_subId;
public:
TaskId(int id, int subId = -1) : m_id(id), m_subId(m_subId){};
CryEngine V
V546 Member of a class is initialized by itself: 'eConfigMax(eConfigMax)'. particleparams.h 1013
ParticleParams() :
....
fSphericalApproximation(1.f),
fVolumeThickness(1.0f),
fSoundFXParam(1.f),
eConfigMax(eConfigMax.VeryHigh), // <=
fFadeAtViewCosAngle(0.f)
{}
ClickHouse
V546 Member of a class is initialized by itself: 'entry(entry)'. PoolWithFailoverBase.h 74
struct TryResult
{
....
explicit TryResult(Entry entry_)
: entry(std::move(entry))
, is_usable(true)
, is_up_to_date(true)
{
}
....
Entry entry;
....
}
Amazon Lumberyard
V546 Member of a class is initialized by itself: 'eConfigMax(eConfigMax.VeryHigh)'. particleparams.h 1837
ParticleParams() :
....
fSphericalApproximation(1.f),
fVolumeThickness(1.0f),
fSoundFXParam(1.f),
eConfigMax(eConfigMax.VeryHigh), // <=
fFadeAtViewCosAngle(0.f)
{}
Blender
V546: Member of a class is initialized with itself: 'owned_data_(std::move(owned_data_))' BLI_virtual_array.hh 1212
MutableVArraySpan(MutableVArraySpan &&other)
: varray_(std::move(other.varray_)),
owned_data_(std::move(owned_data_)),
show_not_saved_warning_(other.show_not_saved_warning_)
{
this->size_ = varray_.size();
const CommonVArrayInfo info = varray_.common_info();
if (info.type == CommonVArrayInfo::Type::Span) {
this->data_ = reinterpret_cast<T *>(info.data);
}
else {
this->data_ = owned_data_.data();
}
other.data_ = nullptr;
other.size_ = 0;
}