[LLVMbugs] [Bug 19123] New: deprecated warning for implicit copy constructor doesn't notice the destructor is defaulted

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 13 00:12:09 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19123

            Bug ID: 19123
           Summary: deprecated warning for implicit copy constructor
                    doesn't notice the destructor is defaulted
           Product: clang
           Version: 3.3
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: peter at stairways.com.au
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I love the new implicit copy constructor warning, but it seems it is
overzealous about what constitutes a user-declared destructor.  For example

class EnumIterator
{
public:
    EnumIterator() = default;
    ~EnumIterator() = default;
};

static void E()
{
    EnumIterator a;
    EnumIterator b;
    b = a;
}

Results in the error:

error: definition of implicit copy assignment operator for 'EnumIterator' is
deprecated because it has a user-declared destructor [-Werror,-Wdeprecated]
        ~EnumIterator() = default;
        ^
note: implicit copy assignment operator for 'EnumIterator' first required here
        b = a;

But clearly, despite technically being user-declared, it is user-decalred to be
the default, which I would think is functionally equivalent to the non-user
declared case.

-- 
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/20140313/b35547de/attachment.html>


More information about the llvm-bugs mailing list