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.
This commit is contained in:
Marek Polacek 2021-09-01 15:17:07 -04:00
parent fbb334a6ac
commit 7c5003c687

View File

@ -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" }
}