From 85ddd7d2e36e2f9bd94c4a2fe572fe44c7573a12 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 18 Nov 2016 11:46:51 +0100 Subject: qdoc: Match unqualified parameter types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clangqdoc was unable to tie qdoc comments to their function declarations for nested classes, when the function had a formal parameter of the nested class type. The problem was that findNodeForCursor() didn't handle the type name scoping correctly. Change-Id: I64d81377193447b1af73ecd107f0431fac0d81a7 Reviewed-by: Topi Reiniƶ --- src/qdoc/clangcodeparser.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/qdoc/clangcodeparser.cpp') diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 0f75724be..f72896dfd 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -208,12 +208,16 @@ static Node *findNodeForCursor(QDocDatabase* qdb, CXCursor cur) { args.append(fromCXString(clang_getTypeSpelling(clang_getArgType(funcType, i)))); QString t1 = funcParams.at(i).dataType(); QString t2 = args.at(i); + auto p2 = parent; + while (p2 && t1 != t2) { + QString parentScope = p2->name() + QLatin1String("::"); + t1 = t1.remove(parentScope); + t2 = t2.remove(parentScope); + p2 = p2->parent(); + } if (t1 != t2) { - QString parentScope = parent->name() + QLatin1String("::"); - if (t1.remove(parentScope) != t2.remove(parentScope)) { - different = true; - break; - } + different = true; + break; } } if (!different) -- cgit v1.2.1