Examples of errors detected by the V546 diagnostic.


V546. Member of a class is initialized by itself: 'Foo(Foo)'.


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;
  ....
}


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++, and C#

goto PVS-Studio;
We use cookies for the analysis of events to improve our content and make user interaction more convenient. By continuing the view of our web-pages you accept the terms of using these files. You can find out more about cookie-files and privacy policy or close the notification, by clicking on the button. Learn More →
Do not show again