Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation node searching for template alias declaration #739

Merged
merged 1 commit into from
Jan 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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