Adapted for clang-3.6