Title
Point of declaration for an alias-declaration
Status
c++11
Section
6.4.2 [basic.scope.pdecl]
Submitter
Daveed Vandevoorde

Created on 2010-03-05.00:00:00 last changed 123 months ago

Messages

Date: 2011-03-15.00:00:00

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

Date: 2011-01-15.00:00:00

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.
Date: 2010-11-15.00:00:00

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.

Date: 2011-02-28.00:00:00

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;
    }
History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3291
2011-04-10 00:00:00adminsetstatus: tentatively ready -> fdis
2011-02-28 00:00:00adminsetmessages: + msg3222
2011-02-28 00:00:00adminsetmessages: + msg3221
2011-02-28 00:00:00adminsetstatus: drafting -> tentatively ready
2010-11-29 00:00:00adminsetstatus: open -> drafting
2010-03-05 00:00:00admincreate