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

2024-10-26


1044. Point of declaration for an alias-declaration

Section: 6.4.2  [basic.scope.pdecl]     Status: C++11     Submitter: Daveed Vandevoorde     Date: 2010-03-05

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

The current wording of 6.4.2 [basic.scope.pdecl] does not specify the point of declaration for an alias-declaration (although it does do so in paragraph 3 for a template alias: “The point of declaration of a template alias immediately follows the identifier for the alias being declared”). One might assume that an alias-declaration would be the same, but it's not clear that that is the right resolution (for either declaration, but especially for the alias-declaration).

An alias-declaration is intended to be essentially a different syntactic form of a typedef declaration (9.2.4 [dcl.typedef] paragraph 2). Placing the point of declaration at the trailing semicolon instead of following the name of the alias would allow more compatibility with the capabilities of typedefs, for instance:

    struct S { };
    namespace N {
        using S = S;
    }

Notes from the November, 2010 meeting:

The CWG agreed that the point of declaration for both template and non-template cases should be at the semicolon.

Proposed resolution (January, 2011):

Change 6.4.2 [basic.scope.pdecl] paragraph 3 as follows:

...The point of declaration of a template an alias or alias template immediately follows the identifier for the alias being declared the type-id to which the alias refers.