[clang] [Concepts] Add regression test for #99036 (PR #113137)

Florian Albrechtskirchinger via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 21 02:32:43 PDT 2024


https://github.com/falbrechtskirchinger created https://github.com/llvm/llvm-project/pull/113137

Add a test case for the assertion error encountered in #99036 and #109354. The issue was incidentally fixed by #111179.

>From a19b65b8512b103afae697cadf1ccd7cce4ef940 Mon Sep 17 00:00:00 2001
From: Florian Albrechtskirchinger <falbrechtskirchinger at gmail.com>
Date: Mon, 21 Oct 2024 11:18:29 +0200
Subject: [PATCH] [Concepts] Add regression test for #99036

Add a test case for the assertion error encountered in #99036 and
#109354. The issue was incidentally fixed by #111179.
---
 clang/test/PCH/cxx2a-constraints-crash.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/clang/test/PCH/cxx2a-constraints-crash.cpp b/clang/test/PCH/cxx2a-constraints-crash.cpp
index 637c55f0c879c9..5c54ba4c425465 100644
--- a/clang/test/PCH/cxx2a-constraints-crash.cpp
+++ b/clang/test/PCH/cxx2a-constraints-crash.cpp
@@ -1,7 +1,5 @@
-// RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
-// RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
-
-// expected-no-diagnostics
+// RUN: %clang_cc1 -std=c++2a -fallow-pch-with-compiler-errors -emit-pch -o %t %s -verify
+// RUN: %clang_cc1 -std=c++2a -fallow-pch-with-compiler-errors -include-pch %t %s -verify
 
 #ifndef HEADER
 #define HEADER
@@ -27,3 +25,12 @@ int main() {
 }
 
 #endif
+
+namespace GH99036 {
+
+template <typename T>
+concept C; // expected-error {{expected '='}}
+
+template <C U> void f();
+
+} // namespace GH99036



More information about the cfe-commits mailing list