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

2024-12-19


2063. Type/nontype hiding in class scope

Section: _N4868_.6.4.1  [basic.scope.declarative]     Status: CD4     Submitter: Hubert Tong     Date: 2014-12-20

[Adopted at the February, 2016 meeting.]

The type/nontype hiding rules (“struct stat hack”) do not apply in class scope. This is a C compatibility 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?

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 which specifies the same unqualified name,