public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3297] c++: Add test for fixed PR [PR101592]
@ 2021-09-01 19:19 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2021-09-01 19:19 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7c5003c6873a941ef75fd31be85dbd37af1fcd23

commit r12-3297-g7c5003c6873a941ef75fd31be85dbd37af1fcd23
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Sep 1 15:17:07 2021 -0400

    c++: Add test for fixed PR [PR101592]
    
    Fixed by my c++/99701 patch.
    
            PR c++/101592
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/warn/Wlogical-op-3.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/warn/Wlogical-op-3.C | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/testsuite/g++.dg/warn/Wlogical-op-3.C b/gcc/testsuite/g++.dg/warn/Wlogical-op-3.C
new file mode 100644
index 00000000000..50b09d57be5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wlogical-op-3.C
@@ -0,0 +1,12 @@
+// PR c++/101592
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2 -Wlogical-op" }
+
+decltype(nullptr) foo ();
+
+bool
+bar ()
+{
+  return foo () > nullptr // { dg-error "ordered comparison" }
+    || foo () < nullptr; // { dg-error "ordered comparison" }
+}


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

only message in thread, other threads:[~2021-09-01 19:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 19:19 [gcc r12-3297] c++: Add test for fixed PR [PR101592] Marek Polacek

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