File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 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)
146146 return static_cast <java_class_typet &>(type);
147147}
148148
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+
149155typet java_int_type ();
150156typet java_long_type ();
151157typet 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)
328328 return static_cast <struct_typet &>(type);
329329}
330330
331+ template <>
332+ inline bool can_cast_type<struct_typet>(const typet &type)
333+ {
334+ return type.id () == ID_struct;
335+ }
336+
331337/* ! \brief C++ class type
332338*/
333339class class_typet :public struct_typet
@@ -432,6 +438,12 @@ inline class_typet &to_class_type(typet &type)
432438 return static_cast <class_typet &>(type);
433439}
434440
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+
435447/* ! \brief The union type
436448*/
437449class union_typet :public struct_union_typet
You can’t perform that action at this time.
0 commit comments