Bug 1623957 - Part 4: Replace mozilla::DeclVal with std::declval. r=jwalden
authorAndré Bargull <andre.bargull@gmail.com>
Sat, 21 Mar 2020 14:19:00 +0000
changeset 519988 ee8e9c99d479d97d96d46fa03aac6ab38cf8a8bf
parent 519987 477dab8b3324eb2939bacc0432b693199e1145c6
child 519989 4e839607dda0e2d12a6f4297f5e57bf7f7b44da6
push id37237
push useraiakab@mozilla.com
push dateSat, 21 Mar 2020 21:28:09 +0000
treeherdermozilla-central@a1bea41f99f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1623957
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1623957 - Part 4: Replace mozilla::DeclVal with std::declval. r=jwalden Differential Revision: https://phabricator.services.mozilla.com/D67651
js/src/gc/GC.cpp
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -192,17 +192,16 @@
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MacroForEach.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Range.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/TextUtils.h"
 #include "mozilla/TimeStamp.h"
-#include "mozilla/TypeTraits.h"
 #include "mozilla/Unused.h"
 
 #include <algorithm>
 #include <initializer_list>
 #include <string.h>
 #include <utility>
 #ifndef XP_WIN
 #  include <sys/mman.h>
@@ -5683,18 +5682,18 @@ IncrementalProgress GCRuntime::sweepShap
 
   return Finished;
 }
 
 // An iterator for a standard container that provides an STL-like begin()/end()
 // interface. This iterator provides a done()/get()/next() style interface.
 template <typename Container>
 class ContainerIter {
-  using Iter = decltype(mozilla::DeclVal<const Container>().begin());
-  using Elem = decltype(*mozilla::DeclVal<Iter>());
+  using Iter = decltype(std::declval<const Container>().begin());
+  using Elem = decltype(*std::declval<Iter>());
 
   Iter iter;
   const Iter end;
 
  public:
   explicit ContainerIter(const Container& container)
       : iter(container.begin()), end(container.end()) {}
 
@@ -5710,17 +5709,17 @@ class ContainerIter {
 
 // IncrementalIter is a template class that makes a normal iterator into one
 // that can be used to perform incremental work by using external state that
 // persists between instantiations. The state is only initialised on the first
 // use and subsequent uses carry on from the previous state.
 template <typename Iter>
 struct IncrementalIter {
   using State = Maybe<Iter>;
-  using Elem = decltype(mozilla::DeclVal<Iter>().get());
+  using Elem = decltype(std::declval<Iter>().get());
 
  private:
   State& maybeIter;
 
  public:
   template <typename... Args>
   explicit IncrementalIter(State& maybeIter, Args&&... args)
       : maybeIter(maybeIter) {
@@ -5856,17 +5855,17 @@ class SweepActionSequence final : public
     for (const auto& action : actions) {
       action->assertFinished();
     }
   }
 };
 
 template <typename Iter, typename Init>
 class SweepActionForEach final : public SweepAction {
-  using Elem = decltype(mozilla::DeclVal<Iter>().get());
+  using Elem = decltype(std::declval<Iter>().get());
   using IncrIter = IncrementalIter<Iter>;
 
   Init iterInit;
   Elem* elemOut;
   UniquePtr<SweepAction> action;
   typename IncrIter::State iterState;
 
  public: