Bug 1028132 - Remove mozilla::HasDangerousPublicDestructor<T>. r=mccr8

This commit is contained in:
Michael Layzell 2015-07-07 18:45:00 -04:00
Родитель 1669cfdfef
Коммит fafaf07b01
1 изменённых файлов: 2 добавлений и 17 удалений

Просмотреть файл

@ -31,14 +31,6 @@
#include "mozilla/MacroForEach.h" #include "mozilla/MacroForEach.h"
#include "mozilla/TypeTraits.h" #include "mozilla/TypeTraits.h"
namespace mozilla {
template <typename T>
struct HasDangerousPublicDestructor
{
static const bool value = false;
};
}
#if defined(__clang__) #if defined(__clang__)
// bug 1028428 shows that at least in FreeBSD 10.0 with Clang 3.4 and libc++ 3.4, // bug 1028428 shows that at least in FreeBSD 10.0 with Clang 3.4 and libc++ 3.4,
// std::is_destructible is buggy in that it returns false when it should return true // std::is_destructible is buggy in that it returns false when it should return true
@ -87,16 +79,9 @@ struct HasDangerousPublicDestructor
#ifdef MOZ_IS_DESTRUCTIBLE #ifdef MOZ_IS_DESTRUCTIBLE
#define MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(X) \ #define MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(X) \
static_assert(!MOZ_IS_DESTRUCTIBLE(X) || \ static_assert(!MOZ_IS_DESTRUCTIBLE(X), \
mozilla::HasDangerousPublicDestructor<X>::value, \
"Reference-counted class " #X " should not have a public destructor. " \ "Reference-counted class " #X " should not have a public destructor. " \
"Try to make this class's destructor non-public. If that is really " \ "Make this class's destructor non-public");
"not possible, you can whitelist this class by providing a " \
"HasDangerousPublicDestructor specialization for it."); \
static_assert(!mozilla::HasDangerousPublicDestructor<X>::value || \
MOZ_IS_DESTRUCTIBLE(X), \
"Class " #X " has no public destructor. That's good! So please " \
"remove the HasDangerousPublicDestructor specialization for it.");
#else #else
#define MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(X) #define MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(X)
#endif #endif