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-6777] c++: add testcase for recently fixed PR [PR103631]
Date: Thu, 20 Jan 2022 18:12:40 +0000 (GMT)	[thread overview]
Message-ID: <20220120181240.3A0CB3858D37@sourceware.org> (raw)

https://gcc.gnu.org/g:2f34d7ef3d026cf7109b6e6bb2eca14c840e7c71

commit r12-6777-g2f34d7ef3d026cf7109b6e6bb2eca14c840e7c71
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Jan 20 13:12:16 2022 -0500

    c++: add testcase for recently fixed PR [PR103631]
    
    We accept this testcase after r12-6773.
    
            PR c++/103631
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/cpp2a/nontype-class51.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/cpp2a/nontype-class51.C | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class51.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class51.C
new file mode 100644
index 00000000000..1501aa1c426
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class51.C
@@ -0,0 +1,26 @@
+// PR c++/103631
+// { dg-do compile { target c++20 } }
+
+template<class Target, template<auto> class T>
+constexpr bool is_specialize_value_v = false;
+
+template<template<auto> class T, auto Ts>
+constexpr bool is_specialize_value_v<T<Ts>, T> = true;
+
+template<class Target, template<auto> class T>
+concept specialize_value = is_specialize_value_v<Target, T>;
+
+template<int> struct Test { };
+
+template<Test>
+struct A {
+  template<class T> void f(T) requires specialize_value<T, A>;
+};
+
+int main() {
+  A<Test<0>{}> a0;
+  A<Test<1>{}> a1;
+  a0.f(a0);
+  a0.f(a1);
+  a0.f(0); // { dg-error "no match" }
+}


                 reply	other threads:[~2022-01-20 18:12 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=20220120181240.3A0CB3858D37@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).