diff options
author | Antal Tátrai <antal.tatrai@gmail.com> | 2016-03-08 20:01:42 +0100 |
---|---|---|
committer | Antal Tátrai <antal.tatrai@gmail.com> | 2016-03-08 20:01:42 +0100 |
commit | e2fb1d982291bfc87693d8a0744213ef22a75c14 (patch) | |
tree | b25f74c7e4e0bfe45d5a3c0aa668e977dc9e5538 /src | |
parent | 3cc35adb6dca9057a790d253b9f5e2b9b000a106 (diff) | |
download | protobuf-e2fb1d982291bfc87693d8a0744213ef22a75c14.tar.gz protobuf-e2fb1d982291bfc87693d8a0744213ef22a75c14.tar.bz2 protobuf-e2fb1d982291bfc87693d8a0744213ef22a75c14.zip |
Comment has been added to fix (issue #1266)
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/map.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 9dd42572..37e19b0a 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<class NodeType, class... Args> 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<void*>(static_cast<const void*>(p))) NodeType(std::forward<Args>(args)...); } |