]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
1 // { dg-options "-std=gnu++0x" }
2 // 2008-05-25 Sebastian Redl <sebastian.redl@getdesigned.at>
4 // Copyright (C) 2008 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 // current_exception() under various conditions.
25 #include <testsuite_hooks.h>
29 bool test
__attribute__((unused
)) = true;
32 exception_ptr ep
= current_exception();
38 bool test
__attribute__((unused
)) = true;
44 exception_ptr ep
= current_exception();
51 bool test
__attribute__((unused
)) = true;
56 } catch(std::exception
&) {
57 exception_ptr ep
= current_exception();
64 bool test
__attribute__((unused
)) = true;
70 exception_ptr ep1
= current_exception();
74 exception_ptr ep2
= current_exception();
77 exception_ptr ep3
= current_exception();
78 // Not guaranteed by standard, but by this implementation.