-
Notifications
You must be signed in to change notification settings - Fork 781
Open
Labels
cwgIssue must be reviewed by CWG.Issue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.Issue is not deemed editorial; the editorial issue is kept open for tracking.
Description
[enum.udecl]/2 contains this example:
enum class fruit { orange, apple };
struct S {
using enum fruit; // OK, introduces orange and apple into S
};
void f() {
S s;
s.orange; // OK, names fruit::orange
S::orange; // OK, names fruit::orange
}
While it is correct that name lookup for orange
in s.orange
will find fruit::orange
, the member access expression itself is not ok, because [expr.ref]/7.5 only specifies its behavior for member enumerators. using enum
however doesn't make the enumerator a member enumerator ([class.mem.general]/3.5, [class.mem.general]/4).
Currently [expr.ref] simply lacks a statement about the behavior in this situation, but CWG issue 2902's proposed resolution would clarify that it is ill-formed.
From issue reported to Clang here.
Metadata
Metadata
Assignees
Labels
cwgIssue must be reviewed by CWG.Issue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.Issue is not deemed editorial; the editorial issue is kept open for tracking.