diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-07-14 17:41:05 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:37:36 +0000 |
commit | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (patch) | |
tree | 6b06b60ff365abef0e13b3503d593a0df48d20e8 /chromium/base/bind_internal.h | |
parent | 7366110654eec46f21b6824f302356426f48cd74 (diff) |
BASELINE: Update Chromium to 52.0.2743.76 and Ninja to 1.7.1
Change-Id: I382f51b959689505a60f8b707255ecb344f7d8b4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/base/bind_internal.h')
-rw-r--r-- | chromium/base/bind_internal.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/chromium/base/bind_internal.h b/chromium/base/bind_internal.h index de14bfff0b4..6e0a425eab0 100644 --- a/chromium/base/bind_internal.h +++ b/chromium/base/bind_internal.h @@ -176,14 +176,14 @@ class RunnableAdapter<R(T::*)(Args...)> { : method_(method) { } - template <typename... RunArgs> - R Run(T* object, RunArgs&&... args) { - return (object->*method_)(std::forward<RunArgs>(args)...); - } - - template <typename RefType, typename... RunArgs> - R Run(const scoped_refptr<RefType>& object, RunArgs&&... args) { - return (object.get()->*method_)(std::forward<RunArgs>(args)...); + template <typename Receiver, typename... RunArgs> + R Run(Receiver&& receiver_ptr, RunArgs&&... args) { + // Clang skips CV qualifier check on a method pointer invocation when the + // receiver is a subclass. Store the receiver into a const reference to + // T to ensure the CV check works. + // https://llvm.org/bugs/show_bug.cgi?id=27037 + T& receiver = *receiver_ptr; + return (receiver.*method_)(std::forward<RunArgs>(args)...); } private: @@ -201,14 +201,14 @@ class RunnableAdapter<R(T::*)(Args...) const> { : method_(method) { } - template <typename... RunArgs> - R Run(const T* object, RunArgs&&... args) { - return (object->*method_)(std::forward<RunArgs>(args)...); - } - - template <typename RefType, typename... RunArgs> - R Run(const scoped_refptr<RefType>& object, RunArgs&&... args) { - return (object.get()->*method_)(std::forward<RunArgs>(args)...); + template <typename Receiver, typename... RunArgs> + R Run(Receiver&& receiver_ptr, RunArgs&&... args) { + // Clang skips CV qualifier check on a method pointer invocation when the + // receiver is a subclass. Store the receiver into a unqualified reference + // to T to ensure the CV check works. + // https://llvm.org/bugs/show_bug.cgi?id=27037 + const T& receiver = *receiver_ptr; + return (receiver.*method_)(std::forward<RunArgs>(args)...); } private: |