use variables to avoid clang warning

This commit is contained in:
Andreas Fabri 2013-03-01 09:01:27 +01:00
parent 455190a2e4
commit 2c8c044db5
2 changed files with 10 additions and 4 deletions

View File

@ -193,7 +193,9 @@ int main ()
q>q; q>r; r>q; q>1; 1>q;
q<=q; q<=r; r<=q; q<=1; 1<=q;
q>=q; q>=r; r>=q; q>=1; 1>=q;
bool b = q==q; b = q==r; b = r==q; b = q==1; b = 1==q;
bool b; // avoid clang warning: equality comparison result unused [-Wunused-comparison]
b = q==q; b = q==r; b = r==q; b = q==1; b = 1==q;
b = q!=q; b = q!=r; b = r!=q; b = q!=1; b = 1!=q;
// Test comparisons with double.

View File

@ -3,6 +3,7 @@
// Sylvain Pion
#include <CGAL/Quotient.h>
#include <CGAL/use.h>
#include <cassert>
#include <CGAL/MP_Float.h>
#ifdef CGAL_USE_GMP
@ -52,10 +53,13 @@ void test_comparison_operators()
-q;
q<q; q<r; r<q; q<1; 1<q;
q>q; q>r; r>q; q>1; 1>q;
q<=q; q<=r; r<=q; q<=1; 1<=q;
bool b; // avoid clang warning: equality comparison result unused [-Wunused-comparison]
b = q<=q; b = q<=r; b = r<=q; b = q<=1; b = 1<=q;
q>=q; q>=r; r>=q; q>=1; 1>=q;
q==q; q==r; r==q; q==1; 1==q;
q!=q; q!=r; r!=q; q!=1; 1!=q;
b = q==q; b = q==r; b = r==q; b = q==1; b = 1==q;
b = q!=q; b = q!=r; b = r!=q; b = q!=1; b = 1!=q;
CGAL_USE(b);
}
int main()