brintos

brintos / llvm-project-archived public Read only

0
0
Text · 882 B · f67ca65 Raw
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