OSDN Git Service

bce8f91567b2cc1e28e7f4e549c446289a10c467
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / 23_containers / deque / capacity / 29134-2.cc
1 // Copyright (C) 2006 Free Software Foundation, Inc.
2 //
3 // This file is part of the GNU ISO C++ Library.  This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 2, or (at your option)
7 // any later version.
8
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without Pred the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
13
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING.  If not, write to the Free
16 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17 // USA.
18
19 // 23.2.1.2 deque capacity [lib.deque.capacity]
20
21 #include <deque>
22 #include <stdexcept>
23 #include <limits>
24 #include <testsuite_hooks.h>
25
26 // libstdc++/29134
27 void test01()
28 {
29   bool test __attribute__((unused)) = true;
30   using namespace std;
31
32   deque<int> d;
33
34   try
35     {
36       d.resize(numeric_limits<size_t>::max());
37     }
38   catch(const std::length_error&)
39     {
40       VERIFY( true );
41     }
42   catch(...)
43     {
44       VERIFY( false );
45     }
46 }
47
48 int main()
49 {
50   test01();
51   return 0;
52 }