From 49dbcfb1ac8f7f74c348408048d9329422b7b8a3 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Fri, 20 Apr 2018 11:28:45 -0700 Subject: [PATCH] fix(util/lean_obj): static assertion is not supported on Clang g++ 4.9 can check it statically, but clang++ fails (at least on OSX). --- src/util/lean_obj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/lean_obj.cpp b/src/util/lean_obj.cpp index 7fdf64b905..0082753826 100644 --- a/src/util/lean_obj.cpp +++ b/src/util/lean_obj.cpp @@ -40,12 +40,12 @@ size_t obj_header_size(lean_obj * o) { static_assert(sizeof(atomic) == sizeof(lean_obj*), "unexpected atomic size, the object GC assumes these two types have the same size"); inline lean_obj * get_next(lean_obj * o) { - static_assert(o == static_cast(&(o->m_rc)), "the object GC relies on the fact that the first field of a structure is stored at offset 0"); + lean_assert(o == static_cast(&(o->m_rc))); // The object GC relies on the fact that the first field of a structure is stored at offset 0 return *reinterpret_cast(o); } inline void set_next(lean_obj * o, lean_obj * n) { - static_assert(o == static_cast(&(o->m_rc)), "the object GC relies on the fact that the first field of a structure is stored at offset 0"); + lean_assert(o == static_cast(&(o->m_rc))); // The object GC relies on the fact that the first field of a structure is stored at offset 0 *reinterpret_cast(o) = n; }