This simple check flags do-while statements according to rule ES.75 of the C++ Core Guidelines.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This is going to be very noisey for codebases that use a do...while macro:
#define MACRO() do { Something(); With(); Multiple(); Statements(); } while (false)
Maybe you should ignore do statements that are in macro expansions as well as potentially do statements with a false condition.
Comment Actions
I updated the check according to the last review.
It ignores now do-while statements which are inside a macro and have a false condition. (false condition part was taken from bugprone-terminating-continue)
Tests were added and the check documentation has now a hint about ignoring do-while statements in macros.
Please highlight do-while with double back-ticks.