sbc100 added a comment. Also, doesn't the existing assert do exactly what you want already: assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr && "Not a Symbol"); ? Repository: rLLD LLVM Linker https://reviews.llvm.org/D43112