public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6777] c++: add testcase for recently fixed PR [PR103631]
@ 2022-01-20 18:12 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2022-01-20 18:12 UTC (permalink / raw)
  To: gcc-cvs

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" }
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-20 18:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 18:12 [gcc r12-6777] c++: add testcase for recently fixed PR [PR103631] 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).