From 64e642cb394a355ef2c63df51b248d29ede4d5e4 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 --HG-- extra : rebase_source : 47c8c4d88946dfcbd5484b5ea7ebcb66c2c27537 --- 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 be5bef3b794d..f4db1e20d800 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 78157142cf46..73733198debf 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