@@ -18,6 +18,7 @@ version (CppRuntime_DigitalMars)
18
18
import core.stdcpp.exception ;
19
19
20
20
extern (C++ , " std" ):
21
+ @nogc :
21
22
22
23
class type_info
23
24
{
@@ -29,8 +30,8 @@ version (CppRuntime_DigitalMars)
29
30
30
31
// bool operator==(const type_info rhs) const;
31
32
// bool operator!=(const type_info rhs) const;
32
- final bool before (const type_info rhs) const ;
33
- final const (char )* name () const ;
33
+ final bool before (const type_info rhs) const nothrow ;
34
+ final const (char )* name () const nothrow ;
34
35
protected :
35
36
// type_info();
36
37
private :
@@ -61,6 +62,7 @@ else version (CppRuntime_Microsoft)
61
62
import core.stdcpp.exception ;
62
63
63
64
extern (C++ , " std" ):
65
+ @nogc :
64
66
65
67
struct __type_info_node
66
68
{
@@ -72,12 +74,11 @@ else version (CppRuntime_Microsoft)
72
74
73
75
class type_info
74
76
{
75
- // virtual ~this();
76
- void dtor () { } // reserve slot in vtbl[]
77
+ @weak ~this () nothrow {}
77
78
// bool operator==(const type_info rhs) const;
78
79
// bool operator!=(const type_info rhs) const;
79
- final bool before (const type_info rhs) const ;
80
- final const (char )* name (__type_info_node* p = &__type_info_root_node) const ;
80
+ final bool before (const type_info rhs) const nothrow ;
81
+ final const (char )* name (__type_info_node* p = &__type_info_root_node) const nothrow ;
81
82
82
83
private :
83
84
void * pdata;
@@ -87,13 +88,13 @@ else version (CppRuntime_Microsoft)
87
88
88
89
class bad_cast : exception
89
90
{
90
- this (const (char )* msg = " bad cast" );
91
+ this (const (char )* msg = " bad cast" ) @nogc nothrow { super (msg); }
91
92
// virtual ~this();
92
93
}
93
94
94
95
class bad_typeid : exception
95
96
{
96
- this (const (char )* msg = " bad typeid" );
97
+ this (const (char )* msg = " bad typeid" ) @nogc nothrow { super (msg); }
97
98
// virtual ~this();
98
99
}
99
100
}
@@ -107,15 +108,17 @@ else version (CppRuntime_Gcc)
107
108
}
108
109
109
110
extern (C++ , " std" ):
111
+ @nogc :
110
112
111
- class type_info
113
+ abstract class type_info
112
114
{
113
- void dtor1 (); // consume destructor slot in vtbl[]
114
- void dtor2 (); // consume destructor slot in vtbl[]
115
- @weak final const ( char ) * name()() const nothrow {
115
+ @weak ~this () {}
116
+ @weak final const ( char ) * name() const nothrow
117
+ {
116
118
return _name[0 ] == ' *' ? _name + 1 : _name;
117
119
}
118
- @weak final bool before()(const type_info _arg) const {
120
+ @weak final bool before(const type_info _arg) const nothrow
121
+ {
119
122
import core.stdc.string : strcmp;
120
123
return (_name[0 ] == ' *' && _arg._name[0 ] == ' *' )
121
124
? _name < _arg._name
@@ -127,29 +130,32 @@ else version (CppRuntime_Gcc)
127
130
bool __do_catch (const type_info, void ** , uint ) const ;
128
131
bool __do_upcast (const __class_type_info* , void ** ) const ;
129
132
133
+ protected :
130
134
const (char )* _name;
131
- this (const (char )* );
135
+
136
+ this (const (char )* name) { _name = name; }
132
137
}
133
138
134
139
class bad_cast : exception
135
140
{
136
- this ();
141
+ this () nothrow {}
137
142
// ~this();
138
- @weak override const (char )* what() const ;
143
+ @weak override const (char )* what() const nothrow { return " bad cast " ; }
139
144
}
140
145
141
146
class bad_typeid : exception
142
147
{
143
- this ();
148
+ this () nothrow {}
144
149
// ~this();
145
- @weak override const (char )* what() const ;
150
+ @weak override const (char )* what() const nothrow { return " bad typeid " ; }
146
151
}
147
152
}
148
153
else version (CppRuntime_Clang )
149
154
{
150
155
import core.stdcpp.exception ;
151
156
152
157
extern (C++ , " std" ):
158
+ @nogc :
153
159
154
160
abstract class type_info
155
161
{
@@ -167,21 +173,21 @@ else version (CppRuntime_Clang)
167
173
protected :
168
174
const (char )* __type_name;
169
175
170
- extern ( D ) this (const (char )* __n) { __type_name = __n; }
176
+ this (const (char )* __n) { __type_name = __n; }
171
177
}
172
178
173
179
class bad_cast : exception
174
180
{
175
- this ();
181
+ this () nothrow {}
176
182
// ~this();
177
- @weak override const (char )* what() const ;
183
+ @weak override const (char )* what() const nothrow { return " bad cast " ; }
178
184
}
179
185
180
186
class bad_typeid : exception
181
187
{
182
- this ();
188
+ this () nothrow {}
183
189
// ~this();
184
- @weak override const (char )* what() const ;
190
+ @weak override const (char )* what() const nothrow { return " bad typeid " ; }
185
191
}
186
192
}
187
193
else
0 commit comments