summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdoc/generatedoutput/testdata
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-09-17 15:00:04 +0200
committerTopi Reinio <topi.reinio@qt.io>2020-09-18 09:23:42 +0200
commit35d963c599471e7c5bb11d06850be7d05830e7cd (patch)
treebfc7346697664610ccef5f4bb3ca6a6c84176dd4 /tests/auto/qdoc/generatedoutput/testdata
parentd99f7d0be90dd9b10efeaa7604d861f0253edc9c (diff)
qdoc: ClangCodeParser: Improve function argument matching
In certain cases, Clang returns a parameter type for a function argument that differs in the header declation and source definition. This can happen if the type has an alias in a different namespace, both namespaces are visible to the source file, and both the type and the alias are included in the pre-compiled header. Resolve these cases by recording the canonical spelling of the header type into Parameter, and comparing it to the canonical spelling from the source file. Remove findFunctionNodeForCursor() as redundant. This makes the fix apply both for /*! */ comments preceding function bodies, as well as separate \fn commands. Fixes: QTBUG-86665 Change-Id: I47566f90adb956095537115ff8e8fcd9c0adffbe Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests/auto/qdoc/generatedoutput/testdata')
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/configs/usingdirective.qdocconf3
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/usingdirective/UsingDirective2
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/usingdirective/alias.h7
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.cpp18
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.h7
5 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/usingdirective.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/usingdirective.qdocconf
new file mode 100644
index 000000000..d5a925b58
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/configs/usingdirective.qdocconf
@@ -0,0 +1,3 @@
+include(config.qdocconf)
+project = UsingDirective
+{includepaths,headerdirs,sourcedirs} = ../usingdirective
diff --git a/tests/auto/qdoc/generatedoutput/testdata/usingdirective/UsingDirective b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/UsingDirective
new file mode 100644
index 000000000..422d01e91
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/UsingDirective
@@ -0,0 +1,2 @@
+#include "alias.h"
+#include "space.h"
diff --git a/tests/auto/qdoc/generatedoutput/testdata/usingdirective/alias.h b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/alias.h
new file mode 100644
index 000000000..1fb9ee471
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/alias.h
@@ -0,0 +1,7 @@
+#pragma once
+
+#include "space.h"
+
+namespace Alias {
+ using spacename = Space::spacename;
+}
diff --git a/tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.cpp b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.cpp
new file mode 100644
index 000000000..4a4962550
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.cpp
@@ -0,0 +1,18 @@
+#include "space.h"
+
+/*!
+ \namespace Space
+ \inmodule UsingDirective
+ \brief A namespace...in space.
+*/
+
+using namespace Alias;
+using namespace Space;
+
+/*!
+ \relates Space
+ A \a space function.
+*/
+void spaceFun(spacename space)
+{
+}
diff --git a/tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.h b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.h
new file mode 100644
index 000000000..9ac01fba6
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/testdata/usingdirective/space.h
@@ -0,0 +1,7 @@
+#pragma once
+
+namespace Space {
+ typedef int spacename;
+}
+
+void spaceFun(Space::spacename space);