Skip to content

Commit

Permalink
Add accessibility check for function definition in public API visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
lcintrat committed Jan 25, 2015
1 parent 472a27b commit 641d51b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,17 @@ private void visitMemberDeclaration(AstNode memberDeclaration) {
}

private void visitFunctionDefinition(AstNode functionDef) {
visitMemberDeclarator(functionDef);
if (isPublicApiMember(functionDef)) {
visitMemberDeclarator(functionDef);
}
}

/**
* Find documentation node, associated documentation,
* identifier of a <em>public</em> member declarator and visit it
* as a public API.
* @param node the <em>public</em> member declarator to visit
*/
private void visitMemberDeclarator(AstNode node) {

AstNode container = node.getFirstAncestor(
Expand Down
3 changes: 3 additions & 0 deletions cxx-squid/src/test/resources/metrics/public_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ struct testStruct {
* bitfield doc
*/
unsigned int bitfield:1;

private:
void private_def(){}
};

/**
Expand Down

0 comments on commit 641d51b

Please sign in to comment.