Browse Source

workaround for a bug of clang (close #281)

Michele Caini 6 years ago
parent
commit
b93ffe3b44
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/entt/core/family.hpp

+ 3 - 2
src/entt/core/family.hpp

@@ -21,7 +21,8 @@ class family {
     inline static ENTT_MAYBE_ATOMIC(ENTT_ID_TYPE) identifier;
     inline static ENTT_MAYBE_ATOMIC(ENTT_ID_TYPE) identifier;
 
 
     template<typename...>
     template<typename...>
-    inline static const auto inner = identifier++;
+    // clang (since version 9) started to complain if auto is used instead of ENTT_ID_TYPE
+    inline static const ENTT_ID_TYPE inner = identifier++;
 
 
 public:
 public:
     /*! @brief Unsigned integer type. */
     /*! @brief Unsigned integer type. */
@@ -29,7 +30,7 @@ public:
 
 
     /*! @brief Statically generated unique identifier for the given type. */
     /*! @brief Statically generated unique identifier for the given type. */
     template<typename... Type>
     template<typename... Type>
-    // at the time I'm writing, clang crashes during compilation if auto is used in place of family_type here
+    // at the time I'm writing, clang crashes during compilation if auto is used instead of family_type
     inline static const family_type type = inner<std::decay_t<Type>...>;
     inline static const family_type type = inner<std::decay_t<Type>...>;
 };
 };