36 lines · plain
1.. title:: clang-tidy - bugprone-lambda-function-name2 3bugprone-lambda-function-name4=============================5 6Checks for attempts to get the name of a function from within a lambda7expression. The name of a lambda is always something like ``operator()``, which8is almost never what was intended.9 10Example:11 12.. code-block:: c++13 14 void FancyFunction() {15 [] { printf("Called from %s\n", __func__); }();16 [] { printf("Now called from %s\n", __FUNCTION__); }();17 }18 19Output::20 21 Called from operator()22 Now called from operator()23 24Likely intended output::25 26 Called from FancyFunction27 Now called from FancyFunction28 29Options30-------31 32.. option:: IgnoreMacros33 34 The value `true` specifies that attempting to get the name of a function from35 within a macro should not be diagnosed. The default value is `false`.36