aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2021-05-05 08:55:02 -0700
committerNathan Sidwell <nathan@acm.org>2021-06-08 11:11:46 -0700
commitb2d0c16e91f39def3646b71e5afebfaea262cca1 (patch)
tree50b3e7db8687429a22802d300092cc6fa5722ca4 /clang/lib/Sema/SemaCodeComplete.cpp
parentde98da2eced72eee791a93b076b70a7b22175abc (diff)
downloadllvm-b2d0c16e91f39def3646b71e5afebfaea262cca1.zip
llvm-b2d0c16e91f39def3646b71e5afebfaea262cca1.tar.gz
llvm-b2d0c16e91f39def3646b71e5afebfaea262cca1.tar.bz2
[clang] p1099 using enum part 2
This implements the 'using enum maybe-qualified-enum-tag ;' part of 1099. 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
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 0bde8ea..1ab9c50 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -3915,6 +3915,9 @@ CXCursorKind clang::getCursorKindForDecl(const Decl *D) {
case Decl::UnresolvedUsingTypename:
return CXCursor_UsingDeclaration;
+ case Decl::UsingEnum:
+ return CXCursor_EnumDecl;
+
case Decl::ObjCPropertyImpl:
switch (cast<ObjCPropertyImplDecl>(D)->getPropertyImplementation()) {
case ObjCPropertyImplDecl::Dynamic: