Reviewers: Lasse Reichstein,

Message:
Old versions of gcc (e.g. 3.4.3) cannot differentiate between


template <class Dest, class Source>
inline Dest BitCast(const Source& source)

and

template <class Dest, class Source>
inline Dest BitCast(Source* const & source)


/home/jill/projects/node/deps/v8/src/factory.h:343: error: call of
overloaded `BitCast(v8::internal::Object**)' is ambiguous
/home/jill/projects/node/deps/v8/src/utils.h:732: note: candidates
are: Dest v8::internal::BitCast(const Source&) [with Dest =
v8::internal::String**, Source = v8::internal::Object**]
/home/jill/projects/node/deps/v8/src/utils.h:743: note:
 Dest v8::internal::BitCast(Source* const&) [with Dest =
v8::internal::String**, Source = v8::internal::Object*]
/home/jill/projects/node/deps/v8/src/factory.h: In static member
function `static v8::internal::Handle<v8::internal::String>
v8::internal::Factory::number_symbol()':


The bug appeared in r5237. This fixes it.

Description:
Remove const from BitCast

Fixes build for old GCCs.

Please review this at http://codereview.chromium.org/3130033/show

Affected files:
  M src/utils.h


Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index d15319c7a1c42408dde7220640f48cb47d38a212..2d0a1bfbdc3ed0d9e963c2567fc57e92213e19d3 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -740,7 +740,7 @@ inline Dest BitCast(const Source& source) {
 }

 template <class Dest, class Source>
-inline Dest BitCast(Source* const & source) {
+inline Dest BitCast(Source* & source) {
     return BitCast<Dest>(reinterpret_cast<uintptr_t>(source));
 }



--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to