assert that FName is a POD and as such is passed directly on registers, so that if it changes to be a non-pod, it won't silently break parameters

This commit is contained in:
Ricardo Luís Vaz Silva 2023-05-30 09:08:19 -03:00 committed by Rachael Alexanderson
parent 61d68eb2d6
commit 49eae74272

View file

@ -45,6 +45,7 @@
#include "memarena.h"
#include "name.h"
#include "scopebarrier.h"
#include <type_traits>
class DObject;
union VMOP;
@ -617,7 +618,7 @@ namespace
template<typename T> struct native_is_valid<T&> { static const bool value = true; static const bool retval = true; };
template<> struct native_is_valid<void> { static const bool value = true; static const bool retval = true; };
template<> struct native_is_valid<int> { static const bool value = true; static const bool retval = true; };
template<> struct native_is_valid<FName> { static const bool value = true; static const bool retval = true; static_assert(sizeof(FName) == sizeof(int)); };
template<> struct native_is_valid<FName> { static const bool value = true; static const bool retval = true; static_assert(sizeof(FName) == sizeof(int)); static_assert(std::is_pod_v<FName>);};
template<> struct native_is_valid<unsigned int> { static const bool value = true; static const bool retval = true; };
template<> struct native_is_valid<double> { static const bool value = true; static const bool retval = true; };
template<> struct native_is_valid<bool> { static const bool value = true; static const bool retval = false;}; // Bool as return does not work!