Injection of elaborated-type-specifier in enumeration scope
6.4.2 [basic.scope.pdecl]
Johannes Schaub

Created on 2010-10-13.00:00:00 last changed 96 months ago


Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

Date: 2010-10-13.00:00:00

According to 6.4.2 [basic.scope.pdecl] paragraph 6,

for an elaborated-type-specifier of the form

    class-key identifier

if the elaborated-type-specifier is used in the decl-specifier-seq or parameter-declaration-clause of a function defined in namespace scope, the identifier is declared as a class-name in the namespace that contains the declaration; otherwise, except as a friend declaration, the identifier is declared in the smallest non-class, non-function-prototype scope that contains the declaration.

This should have been, but was not, updated when enumeration scope (6.4.7 [basic.scope.enum]) was added:

    enum class E {
        e = sizeof((struct S*)0)

Presumably the name S belongs to the same scope as E, not the enumeration scope of E.

Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3292
2011-04-10 00:00:00adminsetstatus: drafting -> fdis
2010-11-29 00:00:00adminsetstatus: open -> drafting
2010-10-13 00:00:00admincreate