Skip to content

Commit

Permalink
Add documentation node searching for template alias declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
lcintrat committed Jan 3, 2016
1 parent 52de9de commit 7a5e47a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,14 @@ private void visitAliasDeclaration(AstNode aliasDeclNode) {
if (aliasDeclIdNode == null) {
LOG.error("No identifier found at {}", aliasDeclNode.getTokenLine());
} else {
// check if this is a template specification to adjust
// documentation node
AstNode template = aliasDeclNode
.getFirstAncestor(CxxGrammarImpl.templateDeclaration);
AstNode docNode = (template != null) ? template : aliasDeclNode;

// look for block documentation
List<Token> comments = getBlockDocumentation(aliasDeclNode);
List<Token> comments = getBlockDocumentation(docNode);

// documentation may be inlined
if (comments.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void no_doc() {

@Test
public void template() {
testFile("src/test/resources/metrics/template.h", 3, 2, true);
testFile("src/test/resources/metrics/template.h", 5, 2, true);
}

@Test
Expand Down
9 changes: 9 additions & 0 deletions cxx-squid/src/test/resources/metrics/template.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ class testClass

int publicAttr;
};

/*!
* \brief issue #736
*/
template <typename T>
using intrinsic_type = typename intrinsic_traits<T>::intrinsic_type;

template <typename T>
using inline_intrinsic_type = typename intrinsic_traits<T>::intrinsic_type; ///< issue #736

0 comments on commit 7a5e47a

Please sign in to comment.