This adds support for p1099's 'using SCOPED_ENUM::MEMNER;'
functionality, bringing a member of an enumerator into the current
scope. The novel feature here, is that there need not be a class
hierarchical relationship between the current scope and the scope of
the SCOPED_ENUM. That's a new thing, the closest equivalent is a
typedef or alias declaration. But this means that
Sema::CheckUsingDeclQualifier needs adjustment. (a) one can't call it
until one knows the set of decls that are being referenced -- if
exactly one is an enumerator, we're in the new territory. Thus it
needs calling later in some cases. Also (b) there are two ways we
hold the set of such decls. During parsing (or instantiating a
dependent scope) we have a lookup result, and during instantiation we
have a set of shadow decls. Thus two optional arguments, at most one
of which should be non-null.
The change to
clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p3.cpp is to
silence an uninteresting access error that the above change causes.
Perhaps deferring the scope check until after construction of the
shadow-decls in the parsing case would be preferred? Also moving up
the check for naming a scoped-enumerator member might be more helpful?