diff gcc/testsuite/g++.dg/concepts/partial-concept-id1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line diff
--- a/gcc/testsuite/g++.dg/concepts/partial-concept-id1.C	Thu Oct 25 07:37:49 2018 +0900
+++ b/gcc/testsuite/g++.dg/concepts/partial-concept-id1.C	Thu Feb 13 11:34:05 2020 +0900
@@ -1,27 +1,37 @@
-// { dg-do compile { target c++17 } }
+// { dg-do compile { target c++17_only } }
 // { dg-options "-fconcepts" }
 
 template<typename T>
-  concept bool Type() { return true; }
+  concept bool Type = true;
+
+template<typename T, typename U>
+  concept bool Same = __is_same_as(T, U);
 
 template<typename T, typename U>
-  concept bool Same() { return __is_same_as(T, U); }
+  concept bool C1 = true;
+
+template<typename T, typename... Args>
+  concept bool C2 = true;
 
 template<typename T, typename U>
-  concept bool C1() { return true; }
-
-template<typename T, typename... Args>
-  concept bool C2() { return true; }
+  concept bool C3 = __is_same_as(T, int) && __is_same_as(U, double);
 
 template<Same<int> T> struct S1 { };
 template<typename T, Same<T> U> struct S2 { };
 
-void f(Same<int> q) { }
-void g(Type a, Same<decltype(a)> b) { }
+template<Same<int> Q>
+void f(Q q) { }
+template<Type A, Same<decltype(A{})> B>
+void g(A a, B b) { }
 
-void h0(Same<int>* a) { }
-void h1(C1<int>* a) { }
-void h2(C2<char, short, int, long>* a) { }
+template<Same<int> A>
+void h0(A* a) { }
+template<C1<int> A>
+void h1(A* a) { }
+template<C2<char, short, int, long> A>
+void h2(A* a) { }
+template<C3<double> A>
+void h3(A* a) { }
 
 int main() {
   S1<int> s1;
@@ -30,5 +40,6 @@
   g(0, 1);
   h0((int*)0);
   h1((int*)0);
-  h2((int*)0);
+  // h2((int*)0);
+  h3((int*)0);
 }