Reviewers: loislo,

Description:
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

Please review this at https://codereview.chromium.org/1073903002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -6 lines):
  M include/v8-profiler.h


Index: include/v8-profiler.h
diff --git a/include/v8-profiler.h b/include/v8-profiler.h
index 4d8dc22fb2047e686a18f9d18cce1e86476198a2..bb1a9b09b9fff233b473250b946055b7d5fc2230 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -25,22 +25,20 @@ struct CpuProfileDeoptFrame {
 };


-#ifdef V8_OS_WIN
-template class V8_EXPORT std::vector<CpuProfileDeoptFrame>;
-#endif
-
-
 struct V8_EXPORT CpuProfileDeoptInfo {
   /** A pointer to a static string owned by v8. */
   const char* deopt_reason;
   std::vector<CpuProfileDeoptFrame> stack;
 };

+}  // namespace v8

 #ifdef V8_OS_WIN
-template class V8_EXPORT std::vector<CpuProfileDeoptInfo>;
+template class V8_EXPORT std::vector<v8::CpuProfileDeoptFrame>;
+template class V8_EXPORT std::vector<v8::CpuProfileDeoptInfo>;
 #endif

+namespace v8 {

 /**
  * CpuProfileNode represents a node in a call graph.


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to