26 lines · plain
1.. title:: clang-tidy - hicpp-undelegated-constructor2.. meta::3 :http-equiv=refresh: 5;URL=../bugprone/undelegated-constructor.html4 5hicpp-undelegated-constructor6=============================7 8This check is an alias for :doc:`bugprone-undelegated-constructor <../bugprone/undelegated-constructor>`.9Partially implements `rule 12.4.5 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/special-member-functions>`_10to find misplaced constructor calls inside a constructor.11 12.. code-block:: c++13 14 struct Ctor {15 Ctor();16 Ctor(int);17 Ctor(int, int);18 Ctor(Ctor *i) {19 // All Ctor() calls result in a temporary object20 Ctor(); // did you intend to call a delegated constructor?21 Ctor(0); // did you intend to call a delegated constructor?22 Ctor(1, 2); // did you intend to call a delegated constructor?23 foo();24 }25 };26