gcc/testsuite/g++.dg/warn/Wsign-compare-9.C
raw| 1 | // PR c++/90691 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-additional-options -Wsign-compare } |
| 4 | |
| 5 | struct S { |
| 6 | int a; |
| 7 | |
| 8 | constexpr S(); |
| 9 | explicit constexpr S(int a_) : a(a_) {} |
| 10 | }; |
| 11 | |
| 12 | constexpr S b = S(12); |
| 13 | |
| 14 | template <const S& e> |
| 15 | bool c(unsigned int d) { |
| 16 | return d >= e.a; |
| 17 | } |
| 18 | |
| 19 | bool test(unsigned int d); |
| 20 | bool test(unsigned int d) { |
| 21 | return c<b>(d); |
| 22 | } |