Statements[Stmt]

6 Statements[Stmt]

statement:
labeled-statement
attribute-specifier-sequenceopt expression-statement
attribute-specifier-sequenceopt compound-statement
attribute-specifier-sequenceopt iteration-statement
attribute-specifier-sequenceopt selection-statement
declaration-statement

6.1 Label Statements[Stmt.Label]

The optional attribute-specifier-sequence applies to the statement that immediately follows it.

6.2 Attributes[Stmt.Attr]

6.2.1 Unroll Attribute[Stmt.Attr.Unroll]

The [unroll] attribute is only valid when applied to iteration-statements. It is used to indicate that iteration-statements like for, while and do while can be unrolled. This attribute qualifier can be used to specify full unrolling or partial unrolling by a specified amount. This is a compiler hint and the compiler may ignore this directive.

The unroll attribute may optionally have an unroll factor represented as a single argument n that is an integer constant expression value greater than zero. If n is not specified, the compiler determines the unrolling factor for the loop. The [unroll] attribute can not be applied to the same iteration-statement as the attribute.

6.2.2 Loop Attribute[Stmt.Attr.Loop]

The Attribute tells the compiler to execute each iteration of the loop. In other words, its a hint to indicate a loop should not be unrolled. Therefore it is not compatible with the attribute.