function_def Production

Definition

function_def : identifier : typename compound_stm

Purpose

A function_def defines a function. The typename defines the function's type, and compound_stm gives the function's body.

Semantics

The type given by typename must be an actual function type. The resulting declaration is treated as having the given type, and it also implicitly constant.

The compound_stm treats the arguments of the typename as initialized local variables, and must return a value of the same type as the return type of typename.

Exactly one function_def may coexist with exactly one uninitialized var_decl, of a type compatible with typename, plus the const type qualifier.