Bug 1310067 - VS2017 doesn't require JS_DEPENDENT_TEMPLATE_HINT workaround. r=jonco, a=IanN CLOSED TREE DONTBUILD SEAMONKEY_2_49_ESR_RELBRANCH
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 21 Nov 2016 11:14:44 +0900
branchSEAMONKEY_2_49_ESR_RELBRANCH
changeset 357479 2a08e3bf9014fdfcd14fb973579ea3bc284408b4
parent 357478 82391ad3a4c05995089737ccbc39f69fa0f62242
child 357480 3d860232518da33642c50490510d6569b4057ce8
push id7834
push userfrgrahl@gmx.net
push dateSun, 13 Jan 2019 12:17:02 +0000
treeherdermozilla-esr52@6e4ad8a8f2e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco, IanN
bugs1310067
milestone52.9.1
Bug 1310067 - VS2017 doesn't require JS_DEPENDENT_TEMPLATE_HINT workaround. r=jonco, a=IanN CLOSED TREE DONTBUILD mozilla-esr52 SEAMONKEY_2_49_ESR_RELBRANCH
js/public/TraceKind.h
--- a/js/public/TraceKind.h
+++ b/js/public/TraceKind.h
@@ -159,22 +159,22 @@ template <> struct MapTypeToRootKind<JSF
 //
 //    DispatchTraceKindTyped(f, thing, traceKind, ... args)
 //
 // Downcast the |void *thing| to the specific type designated by |traceKind|,
 // and pass it to the functor |f| along with |... args|, forwarded. Pass the
 // type designated by |traceKind| as the functor's template argument. The
 // |thing| parameter is optional; without it, we simply pass through |... args|.
 
-// GCC and Clang require an explicit template declaration in front of the
-// specialization of operator() because it is a dependent template. MSVC, on
-// the other hand, gets very confused if we have a |template| token there.
+// VS2017+, GCC and Clang require an explicit template declaration in front of
+// the specialization of operator() because it is a dependent template. VS2015,
+// on the other hand, gets very confused if we have a |template| token there.
 // The clang-cl front end defines _MSC_VER, but still requires the explicit
 // template declaration, so we must test for __clang__ here as well.
-#if defined(_MSC_VER) && !defined(__clang__)
+#if (defined(_MSC_VER) && _MSC_VER < 1910) && !defined(__clang__)
 # define JS_DEPENDENT_TEMPLATE_HINT
 #else
 # define JS_DEPENDENT_TEMPLATE_HINT template
 #endif
 template <typename F, typename... Args>
 auto
 DispatchTraceKindTyped(F f, JS::TraceKind traceKind, Args&&... args)
   -> decltype(f. JS_DEPENDENT_TEMPLATE_HINT operator()<JSObject>(mozilla::Forward<Args>(args)...))