donn@utah-cs.UUCP (Donn Seeley) (04/29/87)
The C++ 1.2.1 translator finds no errors in the following fragment, but
it omits the typedef in the C source output and the C compiler chokes:
------------------------------------------------------------------------
struct x {
typedef char *charptr;
charptr cp;
};
------------------------------------------------------------------------
This is of course illegal syntax for both C++ and C, but our C compiler
flags this error and C++ 1.2.1 does not.
Is there any stylistic or operational reason why typedefs shouldn't
be permitted in member lists? It seems like an omission to me since
it's possible to declare typedef-names in other ways in member lists.
Section r.8.7 of the C++ book specifically rules out typedefs in member
lists.
Donn Seeley University of Utah CS Dept donn@cs.utah.edu
40 46' 6"N 111 50' 34"W (801) 581-5668 utahiteite