Bug 1622688 - Un-#ifdef to enable std::is_trivially_constructible everywhere. r=jwalden

Differential Revision: https://phabricator.services.mozilla.com/D66913

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Masatoshi Kimura 2020-03-19 01:10:47 +00:00
Родитель fa85504114
Коммит 09ce329898
1 изменённых файлов: 0 добавлений и 8 удалений

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

@ -787,20 +787,12 @@ Statistics::Statistics(GCRuntime* gc)
#ifdef DEBUG
for (const auto& duration : totalTimes_) {
# if defined(XP_WIN) || defined(XP_MACOSX) || \
(defined(XP_UNIX) && !defined(__clang__))
// build-linux64-asan/debug and static-analysis-linux64-st-an/debug
// currently use an STL that lacks std::is_trivially_constructible.
// This #ifdef probably isn't as precise as it could be, but given
// |totalTimes_| contains |TimeDuration| defined platform-independently
// it's not worth the trouble to nail down a more exact condition.
using ElementType =
typename mozilla::RemoveReference<decltype(duration)>::Type;
static_assert(!std::is_trivially_constructible<ElementType>::value,
"Statistics::Statistics will only initialize "
"totalTimes_'s elements if their default constructor is "
"non-trivial");
# endif // mess'o'tests
MOZ_ASSERT(duration.IsZero(),
"totalTimes_ default-initialization should have "
"default-initialized every element of totalTimes_ to zero");