Skip to content

[clang][NFC] Add regression tests for GH63782 #109104

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
Sep 18, 2024
Merged

[clang][NFC] Add regression tests for GH63782 #109104

merged 1 commit into from
Sep 18, 2024

Conversation

steakhal
Copy link
Contributor

Patch by Alejandro Alvarez Ayllon!

CPP-5380

Patch by Alejandro Alvarez Ayllon!

CPP-5380
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Sep 18, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 18, 2024

@llvm/pr-subscribers-clang

Author: Balazs Benics (steakhal)

Changes

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

@steakhal steakhal added the skip-precommit-approval PR for CI feedback, not intended for review label Sep 18, 2024
@steakhal steakhal merged commit e32a62c into llvm:main Sep 18, 2024
11 checks passed
@steakhal steakhal deleted the bb/add-tests-for-gh-63782 branch September 18, 2024 09:37
tmsri pushed a commit to tmsri/llvm-project that referenced this pull request Sep 19, 2024
Patch by Alejandro Alvarez Ayllon!

CPP-5380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants