[clang-tools-extra] [clang-doc] Add test case for #141990 (PR #142209)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 30 13:21:27 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: Paul Kirth (ilovepi)

<details>
<summary>Changes</summary>

When we landed the fix for the assertion in #<!-- -->141990, we hadn't yet
reduced the test case sufficiently for a regression test.

---
Full diff: https://github.com/llvm/llvm-project/pull/142209.diff


1 Files Affected:

- (added) clang-tools-extra/test/clang-doc/DR-141990.cpp (+18) 


``````````diff
diff --git a/clang-tools-extra/test/clang-doc/DR-141990.cpp b/clang-tools-extra/test/clang-doc/DR-141990.cpp
new file mode 100644
index 0000000000000..019afb0654c20
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/DR-141990.cpp
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc -output=%t %s 2>&1 | FileCheck %s --implicit-check-not="{{warning|error}}"
+
+// COM: This case triggered an assertion before #141990:
+// COM: clang-doc: llvm-project/clang/lib/AST/Decl.cpp:2985:
+// COM:   Expr *clang::ParmVarDecl::getDefaultArg(): Assertion `!hasUninstantiatedDefaultArg()
+// COM:   && "Default argument is not yet instantiated!"' failed.
+
+template <class = int>
+class c;
+int e;
+
+template <class>
+class c {
+public:
+  void f(int n = e);
+};
+class B : c<> {};

``````````

</details>


https://github.com/llvm/llvm-project/pull/142209


More information about the cfe-commits mailing list