Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.robertl/eb129.C

raw
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 using namespace std;
11 int main()
12 {
13 list<int> l;
14 l.push_back(1);
15 l.push_back(2);
16
17 list<int>::iterator it =
18 find_if( l.begin(), l.end(),
19 // This is a typo, it should be bind2nd, but an
20 // ICE is not a very helpful diagnostic!
21 binder2nd( equal_to<int>(), 2 ) ); // { dg-error "" "" { target c++14_down } }
22 assert( *(it) == 2 );
23 }
24