[clang-tools-extra] e113a72 - [clang-doc] Precommit test case for functions with templated parameters and return
via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 13 09:56:22 PST 2024
Author: Paul Kirth
Date: 2024-12-13T09:56:19-08:00
New Revision: e113a72562e8a7e4493a1de0da01776945d0db74
URL: https://github.com/llvm/llvm-project/commit/e113a72562e8a7e4493a1de0da01776945d0db74
DIFF: https://github.com/llvm/llvm-project/commit/e113a72562e8a7e4493a1de0da01776945d0db74.diff
LOG: [clang-doc] Precommit test case for functions with templated parameters and return
To address #67549 we need a test case that will show up in the markdown
output for functions.
Reviewers: PeterChou1, petrhosek
Reviewed By: petrhosek
Pull Request: https://github.com/llvm/llvm-project/pull/119814
Added:
Modified:
clang-tools-extra/test/clang-doc/templates.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/test/clang-doc/templates.cpp b/clang-tools-extra/test/clang-doc/templates.cpp
index 5ca8768cbdc43c..749d040489a0b4 100644
--- a/clang-tools-extra/test/clang-doc/templates.cpp
+++ b/clang-tools-extra/test/clang-doc/templates.cpp
@@ -9,6 +9,12 @@
// YAML: ---
// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: ChildRecords:
+// YAML-NEXT: - Type: Record
+// YAML-NEXT: Name: 'tuple'
+// YAML-NEXT: QualName: 'tuple'
+// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Path: 'GlobalNamespace'
// MD: # Global Namespace
// MD: ## Functions
@@ -87,9 +93,65 @@ void function<bool, 0>(bool x) {}
// YAML-NEXT: Params:
// YAML-NEXT: - Contents: 'bool'
// YAML-NEXT: - Contents: '0'
-// YAML-NEXT: ...
// MD: ### function
// MD: *void function(_Bool x)*
-// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 27]]*
+// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 26]]*
+
+/// A Tuple type
+///
+/// Does Tuple things.
+template<typename ...Tys>
+struct tuple{};
+
+/// A function with a tuple parameter
+///
+/// \param t The input to func_with_tuple_param
+tuple<int,int,bool> func_with_tuple_param(tuple<int,int,bool> t){ return t;}
+
+// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Name: 'func_with_tuple_param'
+// YAML-NEXT: Description:
+// YAML-NEXT: - Kind: 'FullComment'
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: 'ParagraphComment'
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: 'TextComment'
+// YAML-NEXT: Text: ' A function with a tuple parameter'
+// YAML-NEXT: - Kind: 'ParagraphComment'
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: 'TextComment'
+// YAML-NEXT: - Kind: 'ParamCommandComment'
+// YAML-NEXT: Direction: '[in]'
+// YAML-NEXT: ParamName: 't'
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: 'ParagraphComment'
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: 'TextComment'
+// YAML-NEXT: Text: ' The input to func_with_tuple_param'
+// YAML-NEXT: DefLocation:
+// YAML-NEXT: LineNumber: [[# @LINE - 23]]
+// YAML-NEXT: Filename:
+// YAML-NEXT: Params:
+// YAML-NEXT: - Type:
+// YAML-NEXT: Type: Record
+// YAML-NEXT: Name: 'tuple'
+// YAML-NEXT: QualName: 'tuple<int, int, _Bool>'
+// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Path: 'GlobalNamespace'
+// YAML-NEXT: Name: 't'
+// YAML-NEXT: ReturnType:
+// YAML-NEXT: Type:
+// YAML-NEXT: Type: Record
+// YAML-NEXT: Name: 'tuple'
+// YAML-NEXT: QualName: 'tuple<int, int, _Bool>'
+// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Path: 'GlobalNamespace'
+// YAML-NEXT: ...
+
+// MD: ### func_with_tuple_param
+// MD: *tuple func_with_tuple_param(tuple t)*
+// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 44]]*
+// MD: A function with a tuple parameter
+// MD: **t** The input to func_with_tuple_param
More information about the cfe-commits
mailing list