<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62857>62857</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] Add IgnoreMacros option to bugprone-lambda-function-name
</td>
</tr>
<tr>
<th>Labels</th>
<td>
enhancement,
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
carlosgalvezp
</td>
</tr>
</table>
<pre>
Hi!
We have code like this triggering the `bugprone-lambda-function-name`:
```cpp
#define MY_ASSERT(x) foo(__func__)
void foo(char const* func);
int main()
{
[](int x) { MY_ASSERT(x); }(123);
}
```
Godbolt: https://godbolt.org/z/GqddPvWed
It would be good if an option `IgnoreMacros` could be added to disable the warning in these scenarios. The warning is a true positive and would display the wrong message, but given also file and number information in the assert it should not cause much trouble - at least not more trouble than code filled with `NOLINT`s.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U12v2zYM_TX0C5HApmMnefBDbrN0F1i7Yb1AsaeAlhhbmyx5kpy7218_2EnXrAMGGBZEHh0efnGMpnMiDVRPUB0znlLvQ6M4WB87tlf5Mmat12_NjwaogPwI-eH2_yzY81VQeS1ozR-CqTcRUzBdJ8G4DlMvCHXeTt0YvJOV5aHVvLpMTiXj3crxIFDnUB4eeWfL8qlxvFuo1HIxTvDDb-fDp08__PoCtPsLaI8X74F25_PMeT4D7R-Zrt7oO0L1HFB5FxPQAWf0jC2fHuHGJRzYOKDdN6LtHYK3AgHtZtgSG7ZP_xEE5RPCdoYVVP4rxPb4XXq363uvW28TlAfsUxrjXAw6AZ26m2PtQwd0-gJ0ev-n1r9cP4t-FP2c8NVPVmMr2Hmv0VyQHfpxrvBc_efO-SAfWAUfoc5RfUWz1qIxedQmcmtladcrBze3zrj5GgWjEsfB-LjGl0d_RMYUJsHRR5PMVZCdvkvRJo6W326EwbsOB4mROwF6h-2UsDNXccg2erwYe3vqpqGVgMZdfBh4UX8TgRyjhIQmYewXfucTKp6i4DCpHlPw06x_hZzQCse0IAYf5B9f6tndJvVirBWNryb1c3k-_vzT88cXqPO4znRT6n2550yaot5ttlW1LTdZ3-SqJMr1JW_VfkebPUu7Kbet5LoqeKfqzDSUU5lXREWxoWKzLmRf6FrqPRWtykuBTS4DG7u29jrMLc1MjJM0Ne2qbWa5FRuXFSQS17NTMohLQAT0DoiUZdetktFvs6k6ZqGZiVbt1EXY5NbEFL9RJ5PsstAPz6ojHrTGx2H4OiPJ4_9uaDYF23w3myb1U7tWfgA6zXHvx2oM_ndRCei05BeBTkuKfwcAAP__X9Vk7g">