From 9d0ba1911f3f9148381ba409268df227e2151eb1 Mon Sep 17 00:00:00 2001 From: David Major Date: Wed, 12 Aug 2015 13:25:40 -0400 Subject: [PATCH] Bug 1193459: Fix JS_DEPENDENT_TEMPLATE_HINT for clang-cl. r=jimb --- js/public/TraceKind.h | 4 +++- js/src/vm/UnboxedObject-inl.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/public/TraceKind.h b/js/public/TraceKind.h index be5bef3b794..f4db1e20d80 100644 --- a/js/public/TraceKind.h +++ b/js/public/TraceKind.h @@ -98,7 +98,9 @@ JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF); // 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. -#ifdef _MSC_VER +// 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__) # define JS_DEPENDENT_TEMPLATE_HINT #else # define JS_DEPENDENT_TEMPLATE_HINT template diff --git a/js/src/vm/UnboxedObject-inl.h b/js/src/vm/UnboxedObject-inl.h index 78157142cf4..73733198deb 100644 --- a/js/src/vm/UnboxedObject-inl.h +++ b/js/src/vm/UnboxedObject-inl.h @@ -583,8 +583,8 @@ CopyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* dst, JSObject* src, // Dispatch to specialized methods based on the type of an object. ///////////////////////////////////////////////////////////////////// -// Goop to fix MSVC. See CallTyped in jsgc.h. -#ifdef _MSC_VER +// Goop to fix MSVC. See DispatchTraceKindTyped in TraceKind.h. +#if defined(_MSC_VER) && !defined(__clang__) # define DEPENDENT_TEMPLATE_HINT #else # define DEPENDENT_TEMPLATE_HINT template