public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Patrick Palka <ppalka@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7488] c++: Add testcase for already fixed PR [PR103443]
Date: Fri,  4 Mar 2022 15:17:56 +0000 (GMT)	[thread overview]
Message-ID: <20220304151756.9D8D53857C61@sourceware.org> (raw)

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();
+}


                 reply	other threads:[~2022-03-04 15:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220304151756.9D8D53857C61@sourceware.org \
    --to=ppalka@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).