Topic: Implicit int


Author: mpr@absoft.com (Michael Rice)
Date: 1996/07/19
Raw View
The opening of Section 7 [dcl.dcl] para 7 of the May 1996 draft states:

Only in function declarations for constructors, destructors, and type
conversions can the decl-specifier-seq be omitted. (footnote 67)

footnote 67) The "implicit int" rule of C is no longer supported.

and

Section 7.1.5 Type specifiers [dcl.type] paragraph 3 states:

At least one type-specifier that is not a cv-qualifier is required in a
typedef declaration.  At least one type-specifier that is not a cv-qualifier
is required in a function declaration unless it declares a constructor,
destructor, or type conversion operator.

It seems to me that this wording is not strong enough to completely
rule out "implicit int".  For example, here is a declaration that
has a decl-specifier-seq without a type-specifier:

extern i;

Old rules make this i an int object since the ARM says "If the type-specifier
is missing from a declaration, it is taken to be int."

Is this case addressed somewhere else in the draft or is this undefined?

If there is not another case where having no type-specifier is legal, then
why not say so here, something like:

At least one type-specifier that is not a cv-qualifier is required in a
declaration, unless it is a function declaration declaring a constructor,
destructor, or type conversion operator.

--
Mike Rice (mpr@absoft.com)
Absoft Corporation


[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]