[all-commits] [llvm/llvm-project] 012898: [clang] p1099 using enum part 1

Nathan Sidwell via All-commits all-commits at lists.llvm.org
Tue Jun 8 04:41:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 012898b92cad00e230a960a08a3f418628bec060
      https://github.com/llvm/llvm-project/commit/012898b92cad00e230a960a08a3f418628bec060
  Author: Nathan Sidwell <nathan at acm.org>
  Date:   2021-06-08 (Tue, 08 Jun 2021)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p3.cpp
    A clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p7-cxx20.cpp
    M clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p7.cpp
    M clang/test/SemaCXX/enum-scoped.cpp

  Log Message:
  -----------
  [clang] p1099 using enum part 1

This adds support for p1099's 'using SCOPED_ENUM::MEMBER;'
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.

Differential Revision: https://reviews.llvm.org/D100276




More information about the All-commits mailing list