From 1f7a7b32d721cd48447017340961bf5ec80d199a Mon Sep 17 00:00:00 2001 From: thakis Date: Thu, 9 Apr 2015 14:22:46 -0700 Subject: [PATCH] Fix C++ violation. gcc rejects the following snippet, clang rejects it in -std=c++11 mode: namespace A { template class C {}; } namespace B { template class A::C; } Indeed, the C++ standard says in 14.7.2p2 "An explicit instantiation shall appear in an enclosing namespace of its template", so cl.exe is incorrect to allow this. Just move the instantiation out of the v8 namespace to fix. No intended behavior change. Fixes building with clang-cl on Windows. BUG=chromium:475643 LOG=N TBR=svenpanne@chromium.org Review URL: https://codereview.chromium.org/1073903002 Cr-Commit-Position: refs/heads/master@{#27721} --- include/v8-profiler.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/v8-profiler.h b/include/v8-profiler.h index 4d8dc22fb2..82a14d6600 100644 --- a/include/v8-profiler.h +++ b/include/v8-profiler.h @@ -24,11 +24,13 @@ struct CpuProfileDeoptFrame { size_t position; }; +} // namespace v8 #ifdef V8_OS_WIN -template class V8_EXPORT std::vector; +template class V8_EXPORT std::vector; #endif +namespace v8 { struct V8_EXPORT CpuProfileDeoptInfo { /** A pointer to a static string owned by v8. */ @@ -36,11 +38,13 @@ struct V8_EXPORT CpuProfileDeoptInfo { std::vector stack; }; +} // namespace v8 #ifdef V8_OS_WIN -template class V8_EXPORT std::vector; +template class V8_EXPORT std::vector; #endif +namespace v8 { /** * CpuProfileNode represents a node in a call graph.