Created on 2008-09-18.00:00:00 last changed 19 months ago
Additional notes (February, 2023)
Forwarding to EWG for review of this extension, per decision of the CWG chair. See cplusplus/papers#1466.
EWG 2023-05-11
This is an extension that needs a well-motivated paper to EWG.
With the change from a scope-based to an entity-based definition of friendship (see issues 372 and 580), it could well make sense to grant friendship to enumerations and variables, for example:
enum E: int; class C { static const int i = 5; // Private friend E; friend int x; }; enum E { e = C::i; }; // OK: E is a friend int x = C::i; // OK: x is a friend
According to the current wording of 11.8.4 [class.friend] paragraph 3, the friend declaration of E is well-formed but ignored, while the friend declaration of x is ill-formed.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-05-11 19:49:32 | admin | set | status: open -> nad |
2023-02-12 17:47:41 | admin | set | messages: + msg7199 |
2008-09-18 00:00:00 | admin | create |