| 1 |
// { dg-do assemble } |
| 2 |
// { dg-skip-if "requires hosted libstdc++ for list" { ! hostedlib } } |
| 3 |
// Gives ICE on EGCS release branch as of 98/06/08 on i686-pc-linux-gnulibc1) |
| 4 |
// From: Klaus-Georg Adams <[email protected]> |
| 5 |
// Message-Id: <[email protected]> |
| 6 |
#include <list> |
| 7 |
#include <functional> |
| 8 |
#include <algorithm> |
| 9 |
#include <cassert> |
| 10 |
int main() |
| 11 |
{ |
| 12 |
std::list<int> l; |
| 13 |
l.push_back(1); |
| 14 |
l.push_back(2); |
| 15 |
|
| 16 |
std::list<int>::iterator it = |
| 17 |
std::find_if( l.begin(), l.end(), |
| 18 |
// This is a typo, it should be bind2nd, but an |
| 19 |
// ICE is not a very helpful diagnostic! |
| 20 |
std::binder2nd( std::equal_to<int>(), 2 ) ); // { dg-error "" "" { target c++14_down } } |
| 21 |
assert( *(it) == 2 ); |
| 22 |
} |
| 23 |
|