You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

int short_function();
int some_very_very_very_very_very_very_very_very_long_function();
int main() {
// short condition, no existing newlines
if (short_function()
) {}
// short condition, existing newlines
if (
short_function()
) {}
// long condition, no newlines
if (some_very_very_very_very_very_very_very_very_long_function() &&
some_very_very_very_very_very_very_very_very_long_function()) {}
// long condition, newlines
else if (some_very_very_very_very_very_very_very_very_long_function() &&
some_very_very_very_very_very_very_very_very_long_function()) {}
// switch condition
switch (some_very_very_very_very_very_very_very_very_long_function() &&
some_very_very_very_very_very_very_very_very_long_function()) {
case default: break;
}
// while condition, line comments
while (
// comment 1
short_function()
// comment 2
) {}
// for condition, inline comments
for ( /* a */ int i=0; some_very_very_very_very_very_very_very_very_long_function()
&& some_very_very_very_very_very_very_very_very_long_function() && i < 10; i++ // trailing comment
) {}
}