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

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

Messages

Date: 2023-02-07.19:53:20

CWG 2023-02-07

P1787R6 clarified that the example added to 9.9 [namespace.udecl] paragraph 10 is accepted, even in the non-function case.

Date: 2023-01-07.14:23:21

CWG 2023-01-06

There is implementation divergence in handling this example.

Date: 2023-06-13.14:00:23

Proposed resolution (approved by CWG 2023-06-13):

  1. Add an example to 9.9 [namespace.udecl] paragraph 8 as follows:

    [ Example:
    struct C {
      int i;
    };
    
    struct D1 : C { };
    struct D2 : C { };
    
    struct D3 : D1, D2 {
      using D1::i;   // OK, equivalent to using C::i
      using D1::i;   // error: duplicate
      using D2::i;   // error: duplicate, also names C::i
    };
    
    -- end example ]
  2. 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
    }
    
Date: 2023-06-15.00:00:00

[Accepted as a DR at the June, 2023 meeting.]

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

History
Date User Action Args
2023-12-19 10:15:28adminsetstatus: dr -> drwp
2023-07-16 13:00:43adminsetstatus: ready -> dr
2023-06-13 14:00:23adminsetstatus: tentatively ready -> ready
2023-02-07 19:53:20adminsetmessages: + msg7171
2023-02-07 19:49:45adminsetstatus: review -> tentatively ready
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