Movatterモバイル変換


[0]ホーム

URL:


Issue 2063 - WG21 CWG Issues
Title
Type/nontype hiding in class scope
Status
cd4
Section
_N4868_.6.4.1 [basic.scope.declarative]
Submitter
Hubert Tong

Created on2014-12-20.00:00:00 last changed109 months ago

Messages

msg5589 (view)
Date: 2015-09-15.00:00:00

Proposed resolution (September, 2015):

Change _N4868_.6.4.1 [basic.scope.declarative] paragraph 4 as follows:

Given a set of declarations in a single declarative region, each of whichspecifies the same unqualified name,

  • they shall all refer to the same entity, or all refer tofunctions and function templates; or

  • exactly one declaration shall declare a class name or enumeration namethat is not a typedef name and the other declarations shall all refer tothe same variable, non-static data member, or enumerator, or allrefer to functions and function templates; in this case the class name orenumeration name is hidden (_N4868_.6.4.10 [basic.scope.hiding]). [Note: Anamespace name or a class template name must be unique in its declarativeregion (9.9.3 [namespace.alias], Clause 13 [temp]).—end note]

msg5483 (view)
Date: 2016-02-15.00:00:00

[Adopted at the February, 2016 meeting.]

The type/nontype hiding rules (“struct stathack”) do not apply in class scope. This is a Ccompatibility issue:

  struct A {    struct B { int x; } b;    int B;    // Permitted in C  };

Since the type/nontype hiding rules exist for C compatibility,should this example be supported?

History
DateUserActionArgs
2017-02-06 00:00:00adminsetstatus: tentatively ready -> cd4
2015-11-10 00:00:00adminsetmessages: +msg5589
2015-11-10 00:00:00adminsetstatus: drafting -> tentatively ready
2014-12-20 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp