Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!utah-cs!donn From: donn@utah-cs.UUCP (Donn Seeley) Newsgroups: comp.lang.c++ Subject: C++ 1.2.1 doesn't flag typedefs inside classes Message-ID: <4532@utah-cs.UUCP> Date: Tue, 28-Apr-87 21:03:52 EDT Article-I.D.: utah-cs.4532 Posted: Tue Apr 28 21:03:52 1987 Date-Received: Thu, 30-Apr-87 04:08:17 EDT Organization: University of Utah CS Dept Lines: 21 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