File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,12 @@ inline java_class_typet &to_java_class_type(typet &type)
146
146
return static_cast <java_class_typet &>(type);
147
147
}
148
148
149
+ template <>
150
+ inline bool can_cast_type<java_class_typet>(const typet &type)
151
+ {
152
+ return can_cast_type<class_typet>(type);
153
+ }
154
+
149
155
typet java_int_type ();
150
156
typet java_long_type ();
151
157
typet java_short_type ();
Original file line number Diff line number Diff line change @@ -328,6 +328,12 @@ inline struct_typet &to_struct_type(typet &type)
328
328
return static_cast <struct_typet &>(type);
329
329
}
330
330
331
+ template <>
332
+ inline bool can_cast_type<struct_typet>(const typet &type)
333
+ {
334
+ return type.id () == ID_struct;
335
+ }
336
+
331
337
/* ! \brief C++ class type
332
338
*/
333
339
class class_typet :public struct_typet
@@ -432,6 +438,12 @@ inline class_typet &to_class_type(typet &type)
432
438
return static_cast <class_typet &>(type);
433
439
}
434
440
441
+ template <>
442
+ inline bool can_cast_type<class_typet>(const typet &type)
443
+ {
444
+ return can_cast_type<struct_typet>(type) && type.get_bool (ID_C_class);
445
+ }
446
+
435
447
/* ! \brief The union type
436
448
*/
437
449
class union_typet :public struct_union_typet
You can’t perform that action at this time.
0 commit comments