include::../description.adoc[]

== Noncompliant Code Example

----
foo(); bar(); // Noncompliant
----

== Compliant Solution

----
foo();
bar();
----

== Exceptions

Control flow statements with a single nested statement are ignored.


----
if (condition) doSomething();       // Compliant
while (condition) doSomething();    // Compliant
----

``++case++`` or ``++default++`` statements containing a single statement and followed by ``++break++`` are ignored.


----
switch (foo) {
  case  0: doSomething(); break;    // Compliant
  default: doSomething(); break;    // Compliant
}
----

Statements enclosed in curly braces on the same line are ignored.


----
auto lambda = [](int x) { doSomething(x); return x; }; // Compliant
----

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
