enum_decl Production

Definition

enum_decl : declspec_list enum identifier = type_exp ;
          | declspec_list enum identifier ;

Purpose

A enum_decl declares an enumeration type, or binds an existing one to a name. This is purely for the sake of naming, though it also allows for the creation of an enumeration type with additional declaration specifiers.

Semantics

The initializer expression must be an enumeration type, or a call_exp to a template evaluating to an enumeration type.

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.