repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git]
/
main
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
noexcept06.C
blob
7e1db661ec2c688ab48c2e125588ae73ea6af8b0
1
// Test that checking of a nothrow specification uses the one on the
2
// definition.
3
// { dg-do run { target c++11 } }
4
5
#include <exception>
6
#include <cstdlib>
7
8
void my_unexpected ()
9
{
10
std::abort ();
11
}
12
void my_terminate ()
13
{
14
std::exit (0);
15
}
16
17
void f() throw();
18
void f() noexcept
19
{
20
throw 1;
21
}
22
23
int main()
24
{
25
std::set_unexpected (my_unexpected);
26
std::set_terminate (my_terminate);
27
f();
28
return 1;
29
}