enum_def Production

Definition

enum_def : declspec_list enum identifier { enum_list } ;
         | declspec_list enum { enum_list } ;

Purpose

An enum_def defines an enumeration. The enum_def in which an identifier is given defines a type, whereas the enum_def without an identifier effectively declares a number of constant integer variables.

Semantics

An enum_def and a enum_decl without an initializer that define enumerations of the same name may coexist. An enum_def's elements are declared as constant integers in the present scope and may not conflict with any other declarations.