gcc/testsuite/g++.dg/expr/ptr-comp2.C
raw| 1 | // DR 1512 |
| 2 | // PR c++/87699 |
| 3 | // { dg-do compile { target c++11 } } |
| 4 | |
| 5 | template<class T, decltype((((T*) 0) < nullptr), true) = false> // { dg-error "ordered comparison" } |
| 6 | bool test(T*) |
| 7 | { |
| 8 | return true; |
| 9 | } |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | test((int*)(nullptr)); // { dg-error "no matching function" } |
| 14 | } |