Skip to content

Commit bef98e9

Browse files
authored
[lldb][TypeSystemClang] Set access specifier for EnumConstantDecl's (llvm#174865)
LLDB was already setting the access specifier on `EnumDecl`s unconditionally to `AS_public`. But it wasn't doing so for the `EnumConstantDecl`s. This triggered a Clang assertion during auto-completion of expressions (llvm#171913). Ideally the code-completion accessibility check would honor the `AccessControl` language option, but that change is harder to test/justify. Since this is a pretty straight-forward change I want to land this before trying to do that. There is no test coverage for this because it relies on the order in which Clang decides to check the decls in scope for auto-completion, which seems fragile. It's also consistent with how we handle access to other decls in `TypeSystemClang`. Fixes llvm#171913
1 parent dbd57dc commit bef98e9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8594,6 +8594,7 @@ clang::EnumConstantDecl *TypeSystemClang::AddEnumerationValueToEnumerationType(
85948594
enumerator_decl->setDeclName(&getASTContext().Idents.get(name));
85958595
enumerator_decl->setType(clang::QualType(enutype, 0));
85968596
enumerator_decl->setInitVal(getASTContext(), value);
8597+
enumerator_decl->setAccess(AS_public);
85978598
SetMemberOwningModule(enumerator_decl, enum_decl);
85988599

85998600
if (!enumerator_decl)

0 commit comments

Comments
 (0)