gecko-dev/tools/clang-tidy/test/readability-braces-around-statements.cpp
Sylvestre Ledru e148db5ea3 Bug 1488687 - Enable braces around statements clang-tidy checker r=Ehsan
This will be enabled only at review phase.
If the warning is ignored in phabricator, nothing will happen.

This should be enforced as it is part of the Mozilla coding style:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Control_Structures

Differential Revision: https://phabricator.services.mozilla.com/D5014

--HG--
extra : moz-landing-system : lando
2018-09-05 14:07:58 +00:00

14 lines
231 B
C++

void do_something(const char *) {}
bool cond(const char *) {
return false;
}
void test() {
if (cond("if0") /*comment*/) do_something("same-line");
}
void foo() {
if (1) while (2) if (3) for (;;) do ; while(false) /**/;/**/
}