HomePhabricator

[clang] p1099 using enum part 2

Authored by urnathan on May 5 2021, 8:55 AM.

Description

[clang] p1099 using enum part 2

This implements the 'using enum maybe-qualified-enum-tag ;' part of

  1. It introduces a new 'UsingEnumDecl', subclassed from

'BaseUsingDecl'. Much of the diff is the boilerplate needed to get the
new class set up.

There is one case where we accept ill-formed, but I believe this is
merely an extended case of an existing bug, so consider it
orthogonal. AFAICT in class-scope the c++20 rule is that no 2 using
decls can bring in the same target decl ([namespace.udecl]/8). But we
already accept:

struct A { enum { a }; };
struct B : A { using A::a; };
struct C : B { using A::a;
using B::a; }; // same enumerator

this patch permits mixtures of 'using enum Bob;' and 'using Bob::member;' in the same way.

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

Details

Committed
urnathanJun 8 2021, 11:11 AM
Differential Revision
D102241: [clang] p1099 4/5: using enum EnumTag
Parents
rGde98da2eced7: [CMake] Only include LTO on Apple targets
Branches
Unknown
Tags
Unknown