[clang] [clang][NFC] Add regression tests for GH63782 (PR #109104)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 18 02:01:29 PDT 2024


https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/109104

Patch by Alejandro Alvarez Ayllon!

CPP-5380

>From f495ed375b0581d475e13636e201cef57718d127 Mon Sep 17 00:00:00 2001
From: Alejandro _lvarez Ayll_n <alejandro.alvarez at sonarsource.com>
Date: Wed, 18 Sep 2024 10:58:03 +0200
Subject: [PATCH] [clang][NFC] Add regression tests for GH63782

Patch by Alejandro Alvarez Ayllon!

CPP-5380
---
 .../SemaTemplate/concepts-out-of-line-def.cpp | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/clang/test/SemaTemplate/concepts-out-of-line-def.cpp b/clang/test/SemaTemplate/concepts-out-of-line-def.cpp
index 333187b0d74ad6..5450d105a6f54a 100644
--- a/clang/test/SemaTemplate/concepts-out-of-line-def.cpp
+++ b/clang/test/SemaTemplate/concepts-out-of-line-def.cpp
@@ -622,3 +622,47 @@ void A<T>::method(Ts&... ts)
   } {}
 
 }
+
+namespace GH63782 {
+// GH63782 was also fixed by PR #80594, so let's add a test for it.
+
+template<bool... Vals>
+constexpr bool All = (Vals && ...);
+
+template<bool... Bs>
+class Class {
+  template<typename>
+  requires All<Bs...>
+  void Foo();
+};
+
+template<bool... Bs>
+template<typename>
+requires All<Bs...>
+void Class<Bs...>::Foo() {
+};
+
+} // namespace GH63782
+
+namespace eve {
+// Reduced from the "eve" project
+
+template <typename... Ts>
+struct tuple {
+  template <int I0> requires(I0 <= sizeof...(Ts))
+  constexpr auto split();
+};
+
+template <typename... Ts>
+template <int I0>
+requires(I0 <= sizeof...(Ts))
+constexpr auto tuple<Ts...>::split(){
+  return 0;
+}
+
+int foo() {
+  tuple<int, float> x;
+  return x.split<0>();
+}
+
+} // namespace eve



More information about the cfe-commits mailing list