]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/86953
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Apr 2019 19:06:41 +0000 (19:06 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Apr 2019 19:06:41 +0000 (19:06 +0000)
* g++.dg/cpp0x/constexpr-86953.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270396 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-86953.C [new file with mode: 0644]

index 96d6b1e867bf80f072f2d0eecee54cc7bb62d912..6abbc572ded4c0768a7b3102ec3155c84a7439c5 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/86953
+       * g++.dg/cpp0x/constexpr-86953.C: New test.
+
 2019-04-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
 
        * g++.dg/lto/pr89358_0.C: Replace dg-* with dg-lto-*.
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-86953.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-86953.C
new file mode 100644 (file)
index 0000000..2eabe48
--- /dev/null
@@ -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{};
+}