[clang-tools-extra] [clang-doc] Precommit concept tests (PR #144160)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 13 17:07:14 PDT 2025
================
@@ -0,0 +1,29 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %s
+// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.json
+
+template<typename T>
+concept Addable = requires(T a, T b) {
+ { a + b };
+};
+
+template<typename T>
+requires Addable<T>
+struct MyClass {
+};
+
+// CHECK: "Name": "MyClass",
+// CHECK-NEXT: "Namespace": [
+// CHECK-NEXT: "GlobalNamespace"
+// CHECK-NEXT: ],
+// CHECK-NEXT: "Path": "GlobalNamespace",
+// CHECK-NEXT: "TagType": "struct",
+// CHECK-NEXT: "Template": {
+// CHECK-NOT: "Constraints": [
+// CHECK-NOT: "Addable<T>"
----------------
ilovepi wrote:
Thanks for pointing this out. As discussed offline, let’s ask clang maintainers on discord or discourse about how to handle this. For this patch things are fine though since it’s just documenting the current behavior.
https://github.com/llvm/llvm-project/pull/144160
More information about the cfe-commits
mailing list