== Why is this an issue?

An empty code block is confusing. It will require some effort from maintainers to determine if it is intentional or indicates the implementation is incomplete.

[source,cpp]
----
void foo()
{
  int x;
  if (x == 42)
  // Noncompliant - the following nested block is empty
  {
  }
  else
  {
    doSomething();
  }
}
----

Removing or filling the empty code blocks takes away ambiguity and generally results in a more straightforward and less surprising code.

[source,cpp]
----
void foo()
{
  int x;
  if (x != 42)
  {
    doSomething();
  }
}
----

=== Exceptions

* The rule ignores code blocks that contain comments.
* Functions are not nested blocks, so they can be empty.

[source,cpp]
----
void bar()
// Compliant - functions are not nested blocks
{
}
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
