public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] c++: remove redundant testcase [PR83258]
@ 2023-05-12 12:39 Patrick Palka
  2023-05-12 12:39 ` [pushed] c++: robustify testcase [PR109752] Patrick Palka
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Palka @ 2023-05-12 12:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: Patrick Palka

I noticed only after the fact that the new testcase template/function2.C
(from r14-708-gc3afdb8ba8f183) is just a subset of ext/visibility/anon8.C,
so let's get rid of it.

	PR c++/83258

gcc/testsuite/ChangeLog:

	* g++.dg/ext/visibility/anon8.C: Mention PR83258.
	* g++.dg/template/function2.C: Removed.
---
 gcc/testsuite/g++.dg/ext/visibility/anon8.C | 2 +-
 gcc/testsuite/g++.dg/template/function2.C   | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)
 delete mode 100644 gcc/testsuite/g++.dg/template/function2.C

diff --git a/gcc/testsuite/g++.dg/ext/visibility/anon8.C b/gcc/testsuite/g++.dg/ext/visibility/anon8.C
index bfcc2d06df6..2c3a8acac93 100644
--- a/gcc/testsuite/g++.dg/ext/visibility/anon8.C
+++ b/gcc/testsuite/g++.dg/ext/visibility/anon8.C
@@ -26,7 +26,7 @@ int main ()
     static void fn2 () {}
   };
   call<&B1::fn1> ();
-  call<&B2::fn2> ();	// { dg-error "linkage|no matching" "" { target c++14_down } }
+  call<&B2::fn2> ();	// { dg-error "linkage|no matching" "PR83258" { target c++14_down } }
   call<&fn3> ();
   call<&B1::fn4> ();
   call<&fn5> ();	// { dg-error "linkage|no matching" "" { target { ! c++11 } } }
diff --git a/gcc/testsuite/g++.dg/template/function2.C b/gcc/testsuite/g++.dg/template/function2.C
deleted file mode 100644
index 54c48e6b36f..00000000000
--- a/gcc/testsuite/g++.dg/template/function2.C
+++ /dev/null
@@ -1,8 +0,0 @@
-// PR c++/83258
-
-template<void(*)()> struct A { };
-
-int main() {
-  struct B { static void f() { } };
-  A<B::f> a; // { dg-error "linkage" "" { target c++14_down } }
-}
-- 
2.40.1.552.g91428f078b


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pushed] c++: robustify testcase [PR109752]
  2023-05-12 12:39 [pushed] c++: remove redundant testcase [PR83258] Patrick Palka
@ 2023-05-12 12:39 ` Patrick Palka
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Palka @ 2023-05-12 12:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: Patrick Palka

This rewrites the testcase for PR109752 to make it simpler and more
robust (i.e. no longer dependent on r13-4035-gc41bbfcaf9d6ef).

	PR c++/109752

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-pr109752.C: Rename to ...
	* g++.dg/cpp2a/concepts-complete4.C: ... this.  Rewrite.
---
 .../g++.dg/cpp2a/concepts-complete4.C         | 13 ++++++++++
 .../g++.dg/cpp2a/concepts-pr109752.C          | 26 -------------------
 2 files changed, 13 insertions(+), 26 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C
 delete mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C

diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C
new file mode 100644
index 00000000000..988b0ddcfdd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C
@@ -0,0 +1,13 @@
+// PR c++/109752
+// { dg-do compile { target c++20 } }
+
+template<class T>
+concept C = requires { sizeof(T); } && T::value; // { dg-error "changed from" }
+
+struct A;
+
+static_assert(!C<A>);
+
+struct A { static constexpr bool value = false; };
+
+static_assert(C<A>); // { dg-error "assert" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C
deleted file mode 100644
index d54ce295e50..00000000000
--- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C
+++ /dev/null
@@ -1,26 +0,0 @@
-// PR c++/109752
-// { dg-do compile { target c++20 } }
-
-template <typename _Tp, typename... _Args>
-  inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...);
-    template<typename _Tp, typename _Up>
-      concept __weakly_eq_cmp_with
- = requires(_Tp __t, _Up __u) {    { __u != __t } ; // { dg-error "changed from" }
- };
-  template<typename _Tp>
-    concept regular =  is_constructible_v<_Tp>  && __weakly_eq_cmp_with<_Tp, _Tp>;
-  template<typename _Iter> concept incrementable = true
-&& regular<_Iter>
-&& requires(_Iter __i) { { __i++ } ;}
-;
-template<typename D>
-struct iterator_interface
-{
-  friend constexpr bool operator>=(D lhs, D rhs) requires __weakly_eq_cmp_with<D, D> { return true; }
-};
-template<typename T>
-struct iterator : iterator_interface<iterator<T>>
-{
-    bool operator==(iterator) const;
-};
-static_assert(incrementable<iterator<int>>); // { dg-error "assert" }
-- 
2.40.1.552.g91428f078b


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-12 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 12:39 [pushed] c++: remove redundant testcase [PR83258] Patrick Palka
2023-05-12 12:39 ` [pushed] c++: robustify testcase [PR109752] 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).