[llvm-bugs] [Bug 34298] New: [Regression]

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 23 00:29:42 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34298

            Bug ID: 34298
           Summary: [Regression]
           Product: libc++
           Version: 5.0
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arphaman at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

The following code no longer compiles:

```
#include <functional>    

class Continuation
{
public:
        Continuation(const std::function<Continuation()>& next)
        : m_next(next) {}

        Continuation() {}

private:
        std::function<Continuation ()> m_next;
};
```

Because of the following error:

```
/Users/alex/bisect/b/include/c++/v1/type_traits:4323:23: error: calling
'operator()' with incomplete return type 'Continuation'
_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/alex/bisect/b/include/c++/v1/__config:441:15: note: expanded from macro
'_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Users/alex/bisect/b/include/c++/v1/type_traits:4220:23: note: expanded from
macro '_LIBCPP_INVOKE_RETURN'
    noexcept(noexcept(__VA_ARGS__)) -> decltype(__VA_ARGS__) \
                      ^~~~~~~~~~~
/Users/alex/bisect/b/include/c++/v1/type_traits:4340:9: note: in instantiation
of exception specification for '__invoke<std::__1::function<Continuation ()>
&>' requested here
        _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...));
        ^
/Users/alex/bisect/b/include/c++/v1/__config:441:15: note: expanded from macro
'_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Users/alex/bisect/b/include/c++/v1/functional:1601:33: note: in instantiation
of template class 'std::__1::__invokable_r<void,
std::__1::function<Continuation ()> &>' requested
      here
                                __invokable<_Fp&, _ArgTypes...>::value>
                                ^
/Users/alex/bisect/b/include/c++/v1/functional:1626:9: note: in instantiation
of default argument for '__callable<std::__1::function<Continuation ()> >'
required here
        __callable<_Fp>::value && !is_same<_Fp, function>::value
        ^~~~~~~~~~~~~~~
/Users/alex/bisect/b/include/c++/v1/functional:1628:5: note: in instantiation
of default argument for 'function<std::__1::function<Continuation ()> >'
required here
    function(_Fp);
    ^~~~~~~~~~~~~
/Users/alex/bisect/b/include/c++/v1/functional:1588:28: note: while
substituting deduced template arguments into function template 'function' [with
_Fp =
      std::__1::function<Continuation ()>, $1 = (no value)]
class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
                           ^
cxx.cpp:3:7: note: while declaring the implicit copy constructor for
'Continuation'
class Continuation
      ^
/Users/alex/bisect/b/include/c++/v1/functional:1680:9: note: 'operator()'
declared here
    _Rp operator()(_ArgTypes...) const;
        ^
cxx.cpp:3:7: note: definition of 'Continuation' is not complete until the
closing '}'
class Continuation
      ^
1 error generated.
```

I suspect libc++ for now, but it could be Clang itself.

libc++ r311156, LLVM r311438, Clang r311434

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170823/c4a035cd/attachment.html>


More information about the llvm-bugs mailing list