Skip to content

[clang-doc] Add test case for #141990 #142209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented May 30, 2025

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

When we landed the fix for the assertion in #141990, we hadn't yet
reduced the test case sufficiently for a regression test.
Copy link
Contributor Author

ilovepi commented May 30, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented May 30, 2025

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

Author: Paul Kirth (ilovepi)

Changes

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 --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<> {};

Copy link
Contributor Author

ilovepi commented Jun 3, 2025

Merge activity

  • Jun 3, 4:36 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 3, 4:38 PM UTC: @ilovepi merged this pull request with Graphite.

@ilovepi ilovepi merged commit b76b3f3 into main Jun 3, 2025
13 checks passed
@ilovepi ilovepi deleted the users/ilovepi/clang-doc-assertion-test branch June 3, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants