This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix clang/libc++ build

*** TEST RESULTS FOR COMMIT 3046d67a0e29686ec18abd719660969c97973063 ***

Author: Pedro Alves <>
Branch: master
Commit: 3046d67a0e29686ec18abd719660969c97973063

Fix clang/libc++ build

This fixes the following build error with clang/libc++, reported at

  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
      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
	lj_deleter.emplace (thread);
  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.

2019-01-24  Pedro Alves  <>

	* 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]