[clang-tools-extra] [clang-doc] Add test case for #141990 (PR #142209)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri May 30 13:20:53 PDT 2025
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/142209
When we landed the fix for the assertion in #141990, we hadn't yet
reduced the test case sufficiently for a regression test.
>From b541800f007dd538d2aead1b514bbe55c175d0ca Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Fri, 30 May 2025 13:00:07 -0700
Subject: [PATCH] [clang-doc] Add test case for #141990
When we landed the fix for the assertion in #141990, we hadn't yet
reduced the test case sufficiently for a regression test.
---
clang-tools-extra/test/clang-doc/DR-141990.cpp | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 clang-tools-extra/test/clang-doc/DR-141990.cpp
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<> {};
More information about the cfe-commits
mailing list