1 .. title:: clang-tidy - bugprone-lambda-function-name
3 bugprone-lambda-function-name
4 =============================
6 Checks for attempts to get the name of a function from within a lambda
7 expression. The name of a lambda is always something like ``operator()``, which
8 is almost never what was intended.
14 void FancyFunction() {
15 [] { printf("Called from %s\n", __func__); }();
16 [] { printf("Now called from %s\n", __FUNCTION__); }();
21 Called from operator()
22 Now called from operator()
24 Likely intended output::
26 Called from FancyFunction
27 Now called from FancyFunction
32 .. option:: IgnoreMacros
34 The value `true` specifies that attempting to get the name of a function from
35 within a macro should not be diagnosed. The default value is `false`.