diff options
author | Pedro Alves <palves@redhat.com> | 2019-01-24 18:01:49 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-01-24 18:01:49 +0000 |
commit | 3046d67a0e29686ec18abd719660969c97973063 (patch) | |
tree | 0f380fe4adf9476800cf70cd572b1a4bf5b5ff13 /gdb | |
parent | 353229bf405113e6ba2fe21f2a691bc63aa94bd8 (diff) | |
download | gdb-3046d67a0e29686ec18abd719660969c97973063.zip gdb-3046d67a0e29686ec18abd719660969c97973063.tar.gz gdb-3046d67a0e29686ec18abd719660969c97973063.tar.bz2 |
Fix clang/libc++ build
This fixes the following build error with clang/libc++, reported at
<https://sourceware.org/ml/gdb-patches/2019-01/msg00537.html>:
(...)
In file included from breakpoint.c:34:
In file included from ./inferior.h:54:
./common/forward-scope-exit.h:98:7: error: no matching constructor for
initialization of 'decltype(std::bind(&delete_longjmp_breakpoint,
std::declval<int>()))' (aka '__bind<void (*)(int), int>')
: m_bind_function (std::bind (function, args...))
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./common/gdb_optional.h:155:19: note: in instantiation of member
function 'detail::forward_scope_exit<void (int),
&delete_longjmp_breakpoint, void (int)>::forward_scope_exit' requested
here
new (&m_item) T (std::forward<Args>(args)...);
^
breakpoint.c:11127:18: note: in instantiation of function template
specialization 'gdb::optional<detail::forward_scope_exit<void (int),
&delete_longjmp_breakpoint, void (int)> >::emplace<int &>' requested
here
lj_deleter.emplace (thread);
^
/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:2220:7:
note: candidate constructor (the implicit copy constructor) not
viable: no known conversion from '__bind<[...], int &>' to 'const
__bind<[...], int>' for 1st argument
class __bind
^
(...)
I don't really know why I ended up with a copy here. We can just pass
the arguments directly to the being-constructed bind.
gdb/ChangeLog:
2019-01-24 Pedro Alves <palves@redhat.com>
* common/forward-scope-exit.h
(forward_scope_exit::forward_scope_exit): Pass arguments to
m_bind_function directly, instead of creating a std::bind and
copying that.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/common/forward-scope-exit.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 453677e..e8e0128 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2019-01-24 Pedro Alves <palves@redhat.com> + + * common/forward-scope-exit.h + (forward_scope_exit::forward_scope_exit): Pass arguments to + m_bind_function directly, instead of creating a std::bind and + copying that. + 2019-01-24 Alan Hayward <alan.hayward@arm.com> * aarch64-tdep.c (aapcs_is_vfp_call_or_return_candidate_1): Check diff --git a/gdb/common/forward-scope-exit.h b/gdb/common/forward-scope-exit.h index 8d63915..bffc6e6 100644 --- a/gdb/common/forward-scope-exit.h +++ b/gdb/common/forward-scope-exit.h @@ -95,7 +95,7 @@ class forward_scope_exit<Function, function, Res (Args...)> public: explicit forward_scope_exit (Args ...args) - : m_bind_function (std::bind (function, args...)) + : m_bind_function (function, args...) { /* Nothing. */ } |