From 27832862698d2e7ff57000671a4811a72a9cc154 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 14 Dec 2017 20:13:32 -0500 Subject: [PATCH 05/25] FIXME: reproducer for error: invalid initialization of non-const reference of type 'auto&' from an rvalue of type 'auto' --- cp-stdlib-error.ii | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 cp-stdlib-error.ii diff --git a/cp-stdlib-error.ii b/cp-stdlib-error.ii new file mode 100644 index 0000000..9a1d5d7 --- /dev/null +++ b/cp-stdlib-error.ii @@ -0,0 +1,32 @@ +template +__addressof(_Tp& __r) noexcept +{ return __builtin_addressof(__r); } + +class function<_Res(_ArgTypes...)> +{ + struct once_flag + { + }; + template + call_once + ( + once_flag& __once, + _Callable&& __f, + { + auto __callable = [&] { + }; + __addressof(__callable); + } + once_flag _M_once; + _M_set_delayed_result +( + function<_Ptr_type()> + __res, + { + bool __did_set = false; + call_once + ( + _M_once, + __addressof(__res), + __addressof(__did_set) + ); -- 1.8.5.3