Bug 1310067 - VS2017 doesn't require JS_DEPENDENT_TEMPLATE_HINT workaround. r=jonco
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 21 Nov 2016 11:14:44 +0900
changeset 323559 59375acb5ae8b4fdaba7fe649c25826e48536792
parent 323558 665038e5ef2b980dc38bd44c107803ab0d2de9b4
child 323560 25c7efa29d66e8551572de9a4cbb9a6842bb578d
push id30978
push usercbook@mozilla.com
push dateMon, 21 Nov 2016 14:44:46 +0000
treeherdermozilla-central@0534254e9a40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1310067
milestone53.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 1310067 - VS2017 doesn't require JS_DEPENDENT_TEMPLATE_HINT workaround. r=jonco MozReview-Commit-ID: DuDDyP6tpc8
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)...))