fix AzGenericTypeInfo template handling with clang 12+ (#833)

Co-authored-by: Tom spot Callaway <spot@fedoraproject.org>
monroegm-disable-blank-issue-2
Tom "spot" Callaway 5 years ago committed by GitHub
parent b1fca488bf
commit ef2d89a843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -150,8 +150,13 @@ namespace AZ
// also needs to be an overload for every version because they all represent overloads for different non-types. // also needs to be an overload for every version because they all represent overloads for different non-types.
namespace AzGenericTypeInfo namespace AzGenericTypeInfo
{ {
template<typename...> /// Needs to match declared parameter type.
constexpr bool false_v = false; template <template <typename...> class> constexpr bool false_v1 = false;
template <template <AZStd::size_t...> class> constexpr bool false_v2 = false;
template <template <typename, AZStd::size_t> class> constexpr bool false_v3 = false;
template <template <typename, typename, AZStd::size_t> class> constexpr bool false_v4 = false;
template <template <typename, typename, typename, AZStd::size_t> class> constexpr bool false_v5 = false;
template <template <typename, AZStd::size_t, typename> class> constexpr bool false_v6 = false;
template<typename T> template<typename T>
inline const AZ::TypeId& Uuid() inline const AZ::TypeId& Uuid()
@ -162,7 +167,7 @@ namespace AZ
template<template<typename...> class T> template<template<typename...> class T>
inline const AZ::TypeId& Uuid() inline const AZ::TypeId& Uuid()
{ {
static_assert(false_v<T>, "Missing specialization for this template. Make sure it's registered for type info support."); static_assert(false_v1<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull(); static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
return s_uuid; return s_uuid;
} }
@ -170,7 +175,7 @@ namespace AZ
template<template<AZStd::size_t...> class T> template<template<AZStd::size_t...> class T>
inline const AZ::TypeId& Uuid() inline const AZ::TypeId& Uuid()
{ {
static_assert(false_v<T>, "Missing specialization for this template. Make sure it's registered for type info support."); static_assert(false_v2<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull(); static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
return s_uuid; return s_uuid;
} }
@ -178,7 +183,7 @@ namespace AZ
template<template<typename, AZStd::size_t> class T> template<template<typename, AZStd::size_t> class T>
inline const AZ::TypeId& Uuid() inline const AZ::TypeId& Uuid()
{ {
static_assert(false_v<T>, "Missing specialization for this template. Make sure it's registered for type info support."); static_assert(false_v3<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull(); static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
return s_uuid; return s_uuid;
} }
@ -186,7 +191,7 @@ namespace AZ
template<template<typename, typename, AZStd::size_t> class T> template<template<typename, typename, AZStd::size_t> class T>
inline const AZ::TypeId& Uuid() inline const AZ::TypeId& Uuid()
{ {
static_assert(false_v<T>, "Missing specialization for this template. Make sure it's registered for type info support."); static_assert(false_v4<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull(); static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
return s_uuid; return s_uuid;
} }
@ -194,7 +199,7 @@ namespace AZ
template<template<typename, typename, typename, AZStd::size_t> class T> template<template<typename, typename, typename, AZStd::size_t> class T>
inline const AZ::TypeId& Uuid() inline const AZ::TypeId& Uuid()
{ {
static_assert(false_v<T>, "Missing specialization for this template. Make sure it's registered for type info support."); static_assert(false_v5<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull(); static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
return s_uuid; return s_uuid;
} }
@ -202,7 +207,7 @@ namespace AZ
template<template<typename, AZStd::size_t, typename> class T> template<template<typename, AZStd::size_t, typename> class T>
inline const AZ::TypeId& Uuid() inline const AZ::TypeId& Uuid()
{ {
static_assert(false_v<T>, "Missing specialization for this template. Make sure it's registered for type info support."); static_assert(false_v6<T>, "Missing specialization for this template. Make sure it's registered for type info support.");
static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull(); static const AZ::TypeId s_uuid = AZ::TypeId::CreateNull();
return s_uuid; return s_uuid;
} }

Loading…
Cancel
Save