Topic: typedef
Author: ellis@parc.xerox.com (John Ellis)
Date: 1995/06/19 Raw View
Does the draft standard intend for the following to be legal?
typedef enum e {x = 1};
Section 7, "Declarations", implies that it is:
In the general form of declaration, the optional
init-declarator-list can be omitted only when declaring a class
(_class_), enumeration (_dcl.enum_) or namespace
(_namespace.def_), that is, when the decl- specifier-seq
contains either a class-specifier, an elaborated-type- specifier
with a class-key (_class.name_), an enum-specifier, or a
namespace-definition. In these cases and whenever a
class-specifier, enum-specifier, or namespace-definition is
present in the decl- specifier-seq, the identifiers in these
specifiers are among the names being declared by the declaration
(as class-names, enum-names, enumer- ators, or namespace-name,
depending on the syntax).
This also implies that
typedef int;
is not legal.