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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Balazs Benics (steakhal)

<details>
<summary>Changes</summary>

Patch by Alejandro Alvarez Ayllon!

CPP-5380

---
Full diff: https://github.com/llvm/llvm-project/pull/109104.diff


1 Files Affected:

- (modified) clang/test/SemaTemplate/concepts-out-of-line-def.cpp (+44) 


``````````diff
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

``````````

</details>


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


More information about the cfe-commits mailing list