4 //7.1.3 the typedef specifier
8 typedef int MILES, *KLICKSP;
10 extern KLICKSP metricp;
12 //p2--can redefine to same type
13 typedef struct s { /* ... */ } s;
18 //p3--cannot redefine to a different type in a given scope
19 class complex2 { /* ... */ };// { dg-message "" } .*
20 typedef int complex2;// { dg-error "" } .*
21 typedef int complex3;// { dg-message "" } .*
22 class complex3 { /* ... */ };// { dg-error "" } .*
27 4 A typedef-name that names a class is a class-name (_class.name_). If
28 a typedef-name is used
29 1) following the class-key in an elaborated-type-specifier
30 2) or in the class-head of a class declaration
31 3) or is used as the identifier in the declarator for a
32 constructor or destructor declaration
33 the program is ill-formed. [Example:
40 typedef struct S T; // { dg-message "previous declaration" }
43 struct T * p; // { dg-error "" } using typedef after struct
46 typedef bool short;// { dg-error "" } .*