https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69106

            Bug ID: 69106
           Summary: std::promise should tolerate overloaded &
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

Test case:

#include <future>

struct foo {
    void operator&() const = delete;
};

int main() {
    std::promise<foo> p;
    p.set_value(foo());
}

results in:

In file included from prog.cc:1:0:
/usr/local/gcc-head/include/c++/6.0.0/future: In instantiation of 'static
std::__future_base::_State_baseV2::_Setter<_Res, _Arg&&>
std::__future_base::_State_baseV2::__setter(std::promise<_Res>*, _Arg&&) [with
_Res = foo; _Arg = foo]':
/usr/local/gcc-head/include/c++/6.0.0/future:1081:50:   required from 'void
std::promise<_Res>::set_value(_Res&&) [with _Res = foo]'
prog.cc:9:22:   required from here
/usr/local/gcc-head/include/c++/6.0.0/future:510:49: error: use of deleted
function 'void foo::operator&() const'
           return _Setter<_Res, _Arg&&>{ __prom, &__arg };
                                                 ^~~~~~

prog.cc:4:10: note: declared here
     void operator&() const = delete;
          ^~~~~~~~

Reply via email to