Backport from mainline
2014-04-15  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/60734
	* include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@211197 138bc75d-0d04-0410-961f-82ee72b054a4
Backport from mainline
2014-05-16  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/60966
	* include/std/future (__future_base::_State_baseV2::_M_set_result):
	Signal condition variable after call_once returns.
	(__future_base::_State_baseV2::_M_do_set): Do not signal here.
	(promise::set_value, promise::set_exception): Increment the reference
	count on the shared state until the function returns.
	* testsuite/30_threads/promise/60966.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@211198 138bc75d-0d04-0410-961f-82ee72b054a4