This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53722] New: [C++0x] Returning implicit conversion class with deleted copy constructor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53722

             Bug #: 53722
           Summary: [C++0x] Returning implicit conversion class with
                    deleted copy constructor
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rainarchitect@gmail.com


struct Uncopyable {
public:
    Uncopyable() {}
    Uncopyable(const Uncopyable&) = delete;
};

struct Locker: public Uncopyable {

    Locker(void*) {}

    // declaration without a definition
    //Locker(const Locker&);
};

struct SmartPtr {

        // error: use of deleted function ÂLocker::Locker(const Locker&)Â
    Locker lock() { return 0; }
};

But if uncomment ÂLocker(const Locker&)Â constructor declaration even without a
definition, this code compile and work fine.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]