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

2026-04-17


3167. Initializing typedefs

Section: 9.5  [dcl.init]     Status: open     Submitter: Bee     Date: 2026-02-27

(From submission #856.)

Consider:

  typedef int x = 0;

There is no prohibition against this.

Possible resolution:

  1. Add before 9.3.1 [dcl.decl.general] paragraph 4 and change paragraphs 4 and 5 as follows:

    The initializer of an init-declarator may be present only if the declarator declares a variable and the host scope (6.4.1 [basic.scope.scope]) of the declaration is the same as its target scope.

    The optional requires-clause in of an init-declarator or member-declarator shall may be present only if the declarator declares a templated function (13.1 [temp.pre]). ...
    The optional function-contract-specifier-seq (9.4.1 [dcl.contract.func]) in of an init-declarator shall may be present only if the declarator declares a function.
  2. Remove 9.5.1 [dcl.init.general] paragraph 5 as follows:

    A declaration D of a variable with linkage shall not have an initializer if D inhabits a block scope.