Skip to content

Commit

Permalink
feat: configurable extraction of inaccessible bases
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkrystian committed Nov 27, 2023
1 parent b8b6880 commit a77752e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ jobs:
"generate: %s" \
"multipage: %s" \
"inaccessible-members: never" \
"inaccessible-bases: never" \
"filters:" \
" symbols:" \
" exclude:" \
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/config-file.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ when set to `dependency`.
|No

|inaccessible-members
|Whether to extract inaccessible members. Currently unimplemented.
|Whether to extract private/protected members. `always` or `never`.
|No

|inaccessible-bases
|Whether to extract inaccessible bases. Currently unimplemented.
|Whether to extract private/protected bases. `always` or `never`.

|===
15 changes: 13 additions & 2 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1945,14 +1945,25 @@ class ASTVisitor
{
for(const CXXBaseSpecifier& B : D->bases())
{
AccessSpecifier access = B.getAccessSpecifier();
// KRYSTIAN FIXME: we need finer-grained control
// for protected bases, since an inheriting class
// will have access to the bases public members...
if(config_->inaccessibleBases !=
ConfigImpl::SettingsImpl::ExtractPolicy::Always)
{
if(access == AccessSpecifier::AS_private ||
access == AccessSpecifier::AS_protected)
continue;
}

I.Bases.emplace_back(
// the extraction of the base type is
// performed in direct dependency mode
buildTypeInfo(
B.getType(),
ExtractMode::DirectDependency),
convertToAccessKind(
B.getAccessSpecifier()),
convertToAccessKind(access),
B.isVirtual());
}
}
Expand Down

0 comments on commit a77752e

Please sign in to comment.