public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Add testcase for already fixed PR c++/86953
@ 2019-04-16 19:39 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2019-04-16 19:39 UTC (permalink / raw)
  To: gcc-patches

Hi!

The following PR has been fixed by the changes to evaluate constexpr
functions on pre-folding/genericization trees.

I've tested the following testcase on x86_64-linux and committed to trunk as
obvious, so that we don't regress it.

2019-04-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/86953
	* g++.dg/cpp0x/constexpr-86953.C: New test.

--- gcc/testsuite/g++.dg/cpp0x/constexpr-86953.C.jj	2019-04-16 15:55:53.938063633 +0200
+++ gcc/testsuite/g++.dg/cpp0x/constexpr-86953.C	2019-04-16 15:55:48.072160330 +0200
@@ -0,0 +1,19 @@
+// PR c++/86953
+// { dg-do run { target c++11 } }
+// { dg-options "-O2" }
+
+struct B {
+  double x;
+  bool y, z;
+  constexpr bool operator== (const B& o) const noexcept
+  {
+    return x == o.x && y == o.y && z == o.z;
+  }
+  constexpr bool operator!= (const B& o) const noexcept { return !(*this == o); }
+};
+
+int
+main ()
+{
+  bool b = B{} == B{};
+}

	Jakub

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

only message in thread, other threads:[~2019-04-16 19:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 19:39 [committed] Add testcase for already fixed PR c++/86953 Jakub Jelinek

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).