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
GLOBAL_BAD_TYPEID.cpp
Go to the documentation of this file.
1
// checking for class ::bad_typeid
2
3
25
#include "config.h"
26
27
28
#ifndef _RWSTD_NO_TYPEINFO
29
# include <typeinfo>
30
#else
// if defined (_RWSTD_NO_TYPEINFO)
31
# ifndef _RWSTD_NO_TYPEINFO_H
32
# include <typeinfo.h>
33
# else
// if defined (_RWSTD_NO_TYPEINFO_H)
34
35
// 5.2.8, p6: using typeid() without #including <typeinfo>
36
// first yields undefined behavior...
37
38
class
bad_typeid
{ };
39
40
# endif
// _RWSTD_NO_TYPEINFO_H
41
#endif
// _RWSTD_NO_TYPEINFO
42
43
44
#if 2 == __GNUG__
45
# ifndef _RWSTD_NO_HONOR_STD
46
# ifdef _RWSTD_NO_STD_TERMINATE
47
# include "
terminate.h
"
48
# endif
// _RWSTD_NO_STD_TERMINATE
49
# endif
// _RWSTD_NO_HONOR_STD
50
#endif
// gcc 2.x
51
52
53
struct
S
{
virtual
~S
() { } };
54
55
int
main
()
56
{
57
try
{
58
S
*
s
= 0;
59
60
// expected to throw [std::] bad_typeid
61
typeid
(*s);
62
}
63
catch
(
bad_typeid
&) {
64
return
0;
65
}
66
catch
(...) {
67
// fail if typeid throws anything other than a std::bad_typeid
68
return
1;
69
}
70
71
// fail if typeid doesn't throw
72
return
2;
73
}
s
#define s
Definition
rw_alg_test.h:221
main
int main()
Definition
GLOBAL_BAD_TYPEID.cpp:55
bad_typeid
bad_typeid
Definition
STD_BAD_TYPEID.cpp:59
S
Definition
COLLAPSE_TEMPLATE_STATICS.cpp:40
S::~S
virtual ~S()
Definition
GLOBAL_BAD_TYPEID.cpp:53
terminate.h
Generated by
1.9.8