diff gcc/testsuite/g++.dg/concepts/pr65681.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/pr65681.C	Thu Oct 25 07:37:49 2018 +0900
+++ b/gcc/testsuite/g++.dg/concepts/pr65681.C	Thu Feb 13 11:34:05 2020 +0900
@@ -1,66 +1,45 @@
-// { dg-do compile { target c++17 } }
+// { dg-do compile { target c++17_only } }
 // { dg-options "-fconcepts" }
 
 template<typename T>
-concept bool C()
-{
-  return requires (T t) { t.mf(); };
-}
+concept bool C = requires (T t) { t.mf(); };
 
 template<typename T>
-concept bool CA1()
-{
-  return C<typename T::ca1_type>();
-}
+concept bool CA1 = C<typename T::ca1_type>;
 
 template<typename T>
-concept bool CA2()
-{
-  return CA1<T>() && requires () { typename T::ca2_type; };
-}
+concept bool CA2 = CA1<T> && requires () { typename T::ca2_type; };
 
 template<typename T>
-concept bool CA3()
-{
-  return CA2<T>() && requires () { typename T::ca3_type; };
-}
+concept bool CA3 = CA2<T> && requires () { typename T::ca3_type; };
 
 template<typename T>
-concept bool CB1()
-{
-  return requires () { typename T::cb1_type; };
-}
+concept bool CB1 = requires () { typename T::cb1_type; };
 
 template<typename T>
-concept bool CB2()
-{
-  return CB1<T>() && requires () { typename T::cb2_type; };
-}
+concept bool CB2 = CB1<T> && requires () { typename T::cb2_type; };
 
 template<typename T>
-concept bool CB3()
-{
-  return CB2<T>() && requires () { typename T::cb3_type; };
-}
+concept bool CB3 = CB2<T> && requires () { typename T::cb3_type; };
 
 
 struct MC { void mf(); };
-static_assert(C<MC>(), "");
+static_assert(C<MC>, "");
 
 
 struct MA1 { using ca1_type = MC; };
 struct MA2 : MA1 { using ca2_type = int; };
 struct MA3 : MA2 { using ca3_type = int; };
-static_assert(CA1<MA1>(), "");
-static_assert(CA2<MA2>(), "");
-static_assert(CA3<MA3>(), "");
+static_assert(CA1<MA1>, "");
+static_assert(CA2<MA2>, "");
+static_assert(CA3<MA3>, "");
 
 struct MB1 { using cb1_type = int; };
 struct MB2 : MB1 { using cb2_type = int; };
 struct MB3 : MB2 { using cb3_type = int; };
-static_assert(CB1<MB1>(), "");
-static_assert(CB2<MB2>(), "");
-static_assert(CB3<MB3>(), "");
+static_assert(CB1<MB1>, "");
+static_assert(CB2<MB2>, "");
+static_assert(CB3<MB3>, "");
 
 
 template<typename T1, typename T2>
@@ -73,29 +52,19 @@
 };
 
 template<CA1 T1, CB2 T2>
-  requires !CA2<T1>()
+  requires (!CA2<T1>)
 struct S<T1, T2> // Specialization #2
 {
   static constexpr int value = 2;
 };
 
 template<CA2 T1, CB3 T2>
-  requires !CA3<T1>()
+  requires (!CA3<T1>)
 struct S<T1, T2> // Specialization #3
 {
   static constexpr int value = 3;
 };
 
-S<MA1,MB1> s11;
-S<MA1,MB2> s12;
-S<MA1,MB3> s13;
-S<MA2,MB1> s21;
-S<MA2,MB2> s22;
-S<MA2,MB3> s23;
-S<MA3,MB1> s31;
-S<MA3,MB2> s32;
-S<MA3,MB3> s33;
-
 static_assert(S<MA1,MB1>::value == 1, "");
 static_assert(S<MA1,MB2>::value == 2, "");
 static_assert(S<MA1,MB3>::value == 2, "");