[llvm-bugs] [Bug 34298] [Regression] std::function no longer accepts an incomplete return type.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 10 16:12:58 PDT 2017


Eric Fiselier <eric at efcs.ca> changed:

           What    |Removed                     |Added
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |eric at efcs.ca
         Resolution|---                         |FIXED

--- Comment #9 from Eric Fiselier <eric at efcs.ca> ---
(In reply to Richard Smith from comment #7)
> [res.on.functions]p2:
> "In particular, the effects are undefined [...] if an incomplete type is
> used as a template argument when instantiating a template component, unless
> specifically allowed for that component."
> There does not appear to be any permission granted to use an incomplete type
> as a template argument of std::function<R(ArgTypes...)>, so libc++'s
> behavior seems to be conforming.

@Richard, I'm not sure I agree. The incomplete return type isn't the template
argument, the entire function type is; and the function type itself isn't
incomplete. Obviously std::function<void()> is allowed, and so it seems we
should accept this case as well.

So I don't think this is a extension, but instead required behavior.

@Alex Thanks for the report and original patch. Sorry it took me this long to
get to it.

Fixed in r312890.

This should be backported to 5.0.1, since we unfortunately missed the 5.0
release. @Marshall is that OK with you?

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/20170910/b8fa75b1/attachment.html>

More information about the llvm-bugs mailing list