[stmt.select.general]

# 8 Statements [[stmt]](./#stmt)

## 8.5 Selection statements [[stmt.select]](stmt.select#general)

### 8.5.1 General [stmt.select.general]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L276)

Selection statements choose one of several flows of control[.](#1.sentence-1)

[selection-statement:](#nt:selection-statement "8.5.1 General [stmt.select.general]")  
if constexpropt ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
if constexpropt ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]") else [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
if !opt consteval [*compound-statement*](stmt.block#nt:compound-statement "8.4 Compound statement or block [stmt.block]")  
if !opt consteval [*compound-statement*](stmt.block#nt:compound-statement "8.4 Compound statement or block [stmt.block]") else [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")  
switch ( [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]")opt [*condition*](stmt.pre#nt:condition "8.1 Preamble [stmt.pre]") ) [*statement*](stmt.pre#nt:statement "8.1 Preamble [stmt.pre]")

See [[dcl.meaning]](dcl.meaning "9.3.4 Meaning of declarators") for the optional [*attribute-specifier-seq*](dcl.attr.grammar#nt:attribute-specifier-seq "9.13.1 Attribute syntax and semantics [dcl.attr.grammar]") in a condition[.](#1.sentence-2)

[*Note [1](#note-1)*:

An [*init-statement*](stmt.pre#nt:init-statement "8.1 Preamble [stmt.pre]") ends with a semicolon[.](#1.sentence-3)

â *end note*]

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/statements.tex#L296)

[*Note [2](#note-2)*:

Each [*selection-statement*](#nt:selection-statement "8.5.1 General [stmt.select.general]") and
each substatement of a [*selection-statement*](#nt:selection-statement "8.5.1 General [stmt.select.general]") has a block scope ([[basic.scope.block]](basic.scope.block "6.4.3 Block scope"))[.](#2.sentence-1)

â *end note*]
