This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


576. Typedefs in function definitions

Section: 9.2.4  [dcl.typedef]     Status: CD2     Submitter: Jon Caves     Date: 21 April 2006

[Voted into the WP at the March, 2009 meeting.]

9.2.4 [dcl.typedef] paragraph 1 says,

The typedef specifier shall not be used in a function-definition (9.5 [dcl.fct.def])...

Does this mean that the following is ill-formed?

    void f() {
        typedef int INT;
    }

Proposed resolution (March, 2008):

Change 9.2.4 [dcl.typedef] paragraph 1 as follows:

...The typedef specifier shall not be used in a function-definition (9.5 [dcl.fct.def]), and it shall not be combined in a decl-specifier-seq with any other kind of specifier except a type-specifier, and it shall not be used in the declaration of a function parameter nor in the decl-specifier-seq of a function-definition (9.5 [dcl.fct.def])...

Proposed resolution (September, 2008):

Change 9.2.4 [dcl.typedef] paragraph 1 as follows:

...The typedef specifier shall not be used in a function-definition (9.5 [dcl.fct.def]), and it shall not be combined in a decl-specifier-seq with any other kind of specifier except a type-specifier, and it shall be used neither in the decl-specifier-seq of a parameter-declaration (9.3.4.6 [dcl.fct]) nor in the decl-specifier-seq of a function-definition (9.5 [dcl.fct.def]).