Skip to content

Commit 800adbe

Browse files
committed
Allow dynamic expr cast with code types
1 parent 3ce8f11 commit 800adbe

File tree

2 files changed

+310
-0
lines changed

2 files changed

+310
-0
lines changed

src/util/expr_cast.h

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Author: Nathan Phillips <[email protected]>
3030
/// \return true if \a base is of type \a T
3131
template<typename T> bool can_cast_expr(const exprt &base);
3232

33+
/// Called after casting. Provides a point to assert on the structure of the
34+
/// expr. By default, this is a no-op, but you can provide an overload to
35+
/// validate particular types.
36+
inline void validate_expr(const exprt &) {}
3337

3438
/// \brief Try to cast a constant reference to a generic exprt to a specific
3539
/// derived class

0 commit comments

Comments
 (0)