diff --git a/src/IntrusivePtr.h b/src/IntrusivePtr.h index 600bb5a263..7d9578d29f 100644 --- a/src/IntrusivePtr.h +++ b/src/IntrusivePtr.h @@ -28,11 +28,10 @@ struct NewRef }; /** - * These have to be forward-declared and known here in order for us to be able - * cast them in the `Unref` function. + * This has to be forward declared and known here in order for us to be able + * cast this in the `Unref` function. */ class OpaqueVal; -class TypeVal; /** * An intrusive, reference counting smart pointer implementation. Much like @@ -121,10 +120,9 @@ public: { if ( ptr_ ) { - // For some `Val` subclasses the MSVC compiler does - // not detect them as inheriting from `zeek::Obj`, - // so we have to do that manually. - if constexpr ( std::is_base_of_v ) + // Specializing `OpaqueVal` as MSVC compiler does not detect it + // inheriting from `zeek::Obj` so we have to do that manually. + if constexpr ( std::is_same_v ) Unref(reinterpret_cast(ptr_)); else Unref(ptr_); diff --git a/src/Type.h b/src/Type.h index 6aa43b31b9..311788daa7 100644 --- a/src/Type.h +++ b/src/Type.h @@ -15,13 +15,13 @@ #include "zeek/IntrusivePtr.h" #include "zeek/Obj.h" #include "zeek/Traverse.h" -#include "zeek/ZVal.h" #include "zeek/ZeekList.h" namespace zeek { class Val; +union ZVal; class EnumVal; class RecordVal; class TableVal;