Fix C++ violation.

gcc rejects the following snippet, clang rejects it in -std=c++11 mode:
  namespace A { template<class T> class C {}; }
  namespace B { template class A::C<int>; }

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}
This commit is contained in:
thakis 2015-04-09 14:22:46 -07:00 committed by Commit bot
parent 48eff34c32
commit 1f7a7b32d7

View File

@ -24,11 +24,13 @@ struct CpuProfileDeoptFrame {
size_t position;
};
} // namespace v8
#ifdef V8_OS_WIN
template class V8_EXPORT std::vector<CpuProfileDeoptFrame>;
template class V8_EXPORT std::vector<v8::CpuProfileDeoptFrame>;
#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<CpuProfileDeoptFrame> stack;
};
} // namespace v8
#ifdef V8_OS_WIN
template class V8_EXPORT std::vector<CpuProfileDeoptInfo>;
template class V8_EXPORT std::vector<v8::CpuProfileDeoptInfo>;
#endif
namespace v8 {
/**
* CpuProfileNode represents a node in a call graph.