Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
etc
config
src
FUNCTION_TRY_BLOCK.cpp
Go to the documentation of this file.
1
// checking function-try-block
2
3
25
int
tried
;
26
int
caught
;
27
28
template
<
class
T>
29
T
foo
(
T
t
)
30
try
{
// <-- testing
31
++
tried
;
32
throw
t
;
33
}
34
catch
(
T
) {
35
++
caught
;
36
throw
;
37
}
38
39
40
struct
S
41
{
42
S
(
int
i
)
43
try
// <-- testing
44
:
i_
(
i
) {
45
++
tried
;
46
foo
(
i_
);
47
}
48
catch
(
int
) {
49
++
caught
;
50
throw
;
51
}
52
53
int
i_
;
54
};
55
56
57
int
main
()
58
{
59
int
result
= 0;
60
61
try
{
62
S
s
(123);
63
64
(void)&
s
;
65
66
result
|= 1;
67
}
68
catch
(
int
i
) {
69
if
(
i
!= 123)
70
result
|= 2;
71
72
if
(
tried
!= 2)
73
result
|= 4;
74
75
if
(
caught
!= 2)
76
result
|= 8;
77
}
78
catch
(...) {
79
result
|= 0x10;
80
}
81
82
return
result
;
83
}
i
#define i
Definition
17.names.cpp:126
T
#define T
Definition
17.names.cpp:163
t
#define t
Definition
17.names.cpp:136
i_
#define i_
Definition
17.names.cpp:180
s
#define s
Definition
rw_alg_test.h:221
result
volatile int result
Definition
18.limits.traps.stdcxx-624.cpp:35
caught
int caught
Definition
FUNCTION_TRY_BLOCK.cpp:26
tried
int tried
Definition
FUNCTION_TRY_BLOCK.cpp:25
main
int main()
Definition
FUNCTION_TRY_BLOCK.cpp:57
foo
#define foo(buf, s,...)
Definition
VA_LIST_FUNC_MACRO.cpp:28
S
Definition
COLLAPSE_TEMPLATE_STATICS.cpp:40
S::S
S(int i)
Definition
FUNCTION_TRY_BLOCK.cpp:42
S::i_
int i_
Definition
FUNCTION_TRY_BLOCK.cpp:53
Generated by
1.9.8