blob: a2b39bc4ff30af2b92b20446cef69650359ef4a6 [file] [log] [blame]
.. title:: clang-tidy - bugprone-copy-constructor-init
bugprone-copy-constructor-init
==============================
Finds copy constructors where the constructor doesn't call
the copy constructor of the base class.
.. code-block:: c++
class Copyable {
public:
Copyable() = default;
Copyable(const Copyable &) = default;
};
class X2 : public Copyable {
X2(const X2 &other) {} // Copyable(other) is missing
};
Also finds copy constructors where the constructor of
the base class don't have parameter.
.. code-block:: c++
class X4 : public Copyable {
X4(const X4 &other) : Copyable() {} // other is missing
};
The check also suggests a fix-its in some cases.