[cfe-dev] problem with std::function and virtual destructor

Richard Smith richard at metafoo.co.uk
Sun Jul 15 18:24:08 PDT 2012


On Sun, Jul 15, 2012 at 6:10 PM, Steve Ramsey <clang at lucena.com> wrote:

> On Jul 15, 2012, at 4:12 PM, Richard Smith wrote:
> > On Sun, Jul 15, 2012 at 2:11 PM, Steve Ramsey <clang at lucena.com> wrote:
> >> On Jul 15, 2012, at 1:55 PM, Rich E wrote:
> >> > On Sun, Jul 15, 2012 at 1:38 PM, Steve Ramsey <clang at lucena.com>
> wrote:
> >> >> This is correct behavior as per FDIS 12.8.18. Specifically, since
> there's a user-declared copy constructor, there needs to be a user-declared
> copy-assignment operator, if you want one; otherwise, the implicitly
> declared one is defined as deleted.
> >> >>
> >> > Excuse my ignorance, but how is there a user-declared copy
> constructor?
> >>
> >> Excuse my lack of proofreading; I meant user-declared destructor.
> >>
> > That's still not right: the rule you're referencing only applies to move
> operations. The implicit declaration of non-deleted copy operations still
> happens in this case, but it's deprecated (the committee didn't want to
> break a big pile of existing code, IIUC).
>
> So the bug then is that the deprecated behavior has been prematurely
> removed? I suppose that would be technically correct - and technically
> correct is the best kind of correct.


No, that has nothing to do with the bug. I explained what the actual issue
is, and why the presence of any virtual function in the class triggers it,
in a previous message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120715/703425f5/attachment.html>


More information about the cfe-dev mailing list