message: Added fix for LLVM libcpp typeinfo comparison
diff: // We need to fix for < 7.5, < 8.4, and < 9.2
  #if (( __GNUC__ == 7 && __GNUC_MINOR__ < 5 ) || ( __GNUC__ == 8 && __GNUC_MINOR__ < 4 ) || ( __GNUC__ == 9 && __GNUC_MINOR__ < 2 ))
  #define APPLY_RTTI_ANY_CAST_FIX
  +#define STD_ANY_ALIGNED_STORAGE_SIZE 1
  +#endif
  +#endif
  +
  +// Fix for LLVM libc++: it also has a problem with typeinfo comparison.
  +#ifndef APPLY_RTTI_ANY_CAST_FIX
  +#ifdef _LIBCPP_VERSION
  +#if !defined(_LIBCPP_NO_RTTI)
  +#define APPLY_RTTI_ANY_CAST_FIX
  +#define STD_ANY_ALIGNED_STORAGE_SIZE 3
  +#endif
  #endif
  #endif
  namespace __internal {
  union Storage {
  void *_M_ptr;
  - std::aligned_storage<sizeof(_M_ptr), alignof(void *)>::type _M_buffer;
  + std::aligned_storage<STD_ANY_ALIGNED_STORAGE_SIZE*sizeof(_M_ptr), alignof(void *)>::type _M_buffer;
  };
  typedef void (*funcPtr)(void);
  @@ -61,6 +72,14 @@ template <typename T> T force_cast(std::any in_any) {
  return *val;
  }
  }
  +
  +template <typename T> bool isType(std::any in_any) {
  + if ((in_any.type() == typeid(T)) ||
  + (strcmp(in_any.type().name(), typeid(T).name()) == 0)) {
  + return true;
  + }
  + return false;
  +}
  } // namespace __internal
  #endif
  @@ -214,7 +233,7 @@ public:
  std::any_cast<T>(items.at(key));
  } catch (std::exception &e) {
  #ifdef APPLY_RTTI_ANY_CAST_FIX
  - return items.at(key).type() == typeid(T);
  + return __internal::isType<T>(items.at(key));
  #else
  return false;
  #endif
  