Skip to content

Commit 188f263

Browse files
committed
Enable casting from derived types to other derived types
1 parent 6daa8bd commit 188f263

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/expr_cast.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ auto expr_try_dynamic_cast(TExpr &base)
7474
typename detail::expr_try_dynamic_cast_return_typet<T, TExpr>::type
7575
returnt;
7676
static_assert(
77-
std::is_same<typename std::decay<TExpr>::type, exprt>::value,
77+
std::is_base_of<exprt, typename std::decay<TExpr>::type>::value,
7878
"Tried to expr_try_dynamic_cast from something that wasn't an exprt");
7979
static_assert(
8080
std::is_base_of<exprt, T>::value,

0 commit comments

Comments
 (0)