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

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 18 02:37:31 PDT 2024


Author: Balazs Benics
Date: 2024-09-18T11:37:27+02:00
New Revision: e32a62c0d31cdfd622461eb4758d34adca509a62

URL: https://github.com/llvm/llvm-project/commit/e32a62c0d31cdfd622461eb4758d34adca509a62
DIFF: https://github.com/llvm/llvm-project/commit/e32a62c0d31cdfd622461eb4758d34adca509a62.diff

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

Patch by Alejandro Alvarez Ayllon!

CPP-5380

Added: 
    

Modified: 
    clang/test/SemaTemplate/concepts-out-of-line-def.cpp

Removed: 
    


################################################################################
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