Apply patch from Lars that aliases static_pointer_cast.