public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7488] c++: Add testcase for already fixed PR [PR103443]
@ 2022-03-04 15:17 Patrick Palka
0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2022-03-04 15:17 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:074d283e249c7295d783a08eb6f0219a7f411c50
commit r12-7488-g074d283e249c7295d783a08eb6f0219a7f411c50
Author: Patrick Palka <ppalka@redhat.com>
Date: Fri Mar 4 10:17:30 2022 -0500
c++: Add testcase for already fixed PR [PR103443]
Fixed by r12-7264.
PR c++/103443
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/consteval29.C: New test.
Diff:
---
gcc/testsuite/g++.dg/cpp2a/consteval29.C | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval29.C b/gcc/testsuite/g++.dg/cpp2a/consteval29.C
new file mode 100644
index 00000000000..61590225bd6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval29.C
@@ -0,0 +1,20 @@
+// PR c++/103443
+// { dg-do compile { target c++20 } }
+
+template<int...>
+struct A { };
+
+template<int... Is>
+consteval unsigned index_sequence2mask(A<Is...>) {
+ if constexpr (sizeof...(Is) == 0u)
+ return 0u;
+ else
+ return ((1u << Is) | ...);
+}
+
+template<unsigned Mask = index_sequence2mask(A<1,2,3>{})>
+void use_mask();
+
+int main() {
+ use_mask();
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-04 15:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04 15:17 [gcc r12-7488] c++: Add testcase for already fixed PR [PR103443] Patrick Palka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).