9 Declarations [dcl.dcl]

9.7 Enumerations [enum]

9.7.2 The using enum declaration [enum.udecl]

using-enum-declaration:
using elaborated-enum-specifier ;
The elaborated-enum-specifier shall not name a dependent type and the type shall have a reachable enum-specifier.
A using-enum-declaration introduces the enumerator names of the named enumeration as if by a using-declaration for each enumerator.
[Note
:
A using-enum-declaration in class scope adds the enumerators of the named enumeration as members to the scope.
This means they are accessible for member lookup.
[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
}
— end example
]
— end note
]
[Note
:
Two using-enum-declarations that introduce two enumerators of the same name conflict.
[Example
:
enum class fruit { orange, apple };
enum class color { red, orange };
void f() {
  using enum fruit;             // OK
  using enum color;             // error: color​::​orange and fruit​::​orange conflict
}
— end example
]
— end note
]