Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wsign-compare-7.C

raw
1 // PR c++/59231
2 // { dg-options "-Wsign-compare" }
3
4 template<class X, class Y>
5 bool equals(X x, Y y)
6 {
7 return (x == y); // { dg-warning "signed" }
8 }
9
10 int main()
11 {
12 unsigned long x = 2;
13 signed int y = 2;
14
15 if(!equals (x, y))
16 return 1;
17 return 0;
18 }