diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 9dd425726d..37e19b0a7d 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -548,6 +548,10 @@ class Map { !defined(GOOGLE_PROTOBUF_OS_NACL) && !defined(GOOGLE_PROTOBUF_OS_ANDROID) template void construct(NodeType* p, Args&&... args) { + // Clang 3.6 doesn't compile static casting to void* directly. (Issue #1266) + // According C++ standard 5.2.9/1: "The static_cast operator shall not cast + // away constness". So first the maybe const pointer is casted to const void* and + // after the const void* is const casted. new (const_cast(static_cast(p))) NodeType(std::forward(args)...); }