Title
Example for member redeclarations with using-declarations
Status
review
Section
9.9 [namespace.udecl]
Submitter
Shafik Yaghmour

Created on 2022-11-28.00:00:00 last changed 3 weeks ago

Messages

Date: 2023-01-07.14:23:21

CWG 2023-01-06

There is implementation divergence in handling this example.

Date: 2023-01-07.14:23:21

Proposed resolution:

Change the example in 9.9 [namespace.udecl] paragraph 10 as follows:

  using B::x;
  using A::x;              // OK, hides struct B::x
  using A::x;              // OK, does not conflict with previous using A::x
  x = 99;                  // assigns to A::x
  struct x x1;             // x1 has class type B::x
}

struct C {
  int i;
  static int j;
};

struct D1 : C { };
struct D2 : C { };

struct D3 : virtual D1, virtual D2 {
  using D1::i;   // OK
  using D2::i;   // OK
  using D1::j;   // OK
  using D2::j;   // OK

  using D1::i;   // error: conflicts
  using D2::i;   // error: conflicts
  using D1::j;   // error: conflicts
  using D2::j;   // error: conflicts
};


Date: 2022-11-28.00:00:00

Issue 36 was resolved by P1787R6, but no example was added.

History
Date User Action Args
2023-01-07 14:23:21adminsetmessages: + msg7119
2023-01-07 14:23:21adminsetstatus: open -> review
2022-12-04 20:52:04adminsetmessages: + msg7089
2022-11-28 00:00:00admincreate