Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrey_K_
Beginner
124 Views

(c++11) failed to compile class with private explicitly-defaulted destructor

Jump to solution

Hi, trying to compile following code:

class Foo{
private:
    //explicitly-defaulted destructor
    ~Foo() = default;
public:
    int x;
    void release(){
        delete this;
    }
};

void PrivateDestructor(){
    auto foo = new Foo();
    foo->release();
}

I get this error: (8): error : assertion failed at: "shared/cfe/edgcpfe/symbol_tbl.c", line 10293

I'm using Intel® C++ Composer XE 2015 for Visual Studio 2013 Update1

0 Kudos
1 Solution
pbkenned1
Employee
124 Views

I can reproduce the assertion.  I'll report this to the developers

Patrick

View solution in original post

3 Replies
pbkenned1
Employee
125 Views

I can reproduce the assertion.  I'll report this to the developers

Patrick

View solution in original post

pbkenned1
Employee
124 Views

This appears to be unique to Windows 14/15, as the Linux 14.0.3 and 15.0 compilers compile this with no issue.  Further, VS2013 C++ compiles this correctly.

I reported this to the developers as defect # DPD200256291.  I'll keep this thread updated with the repair progress.

Patrick

 

Andrey_K_
Beginner
124 Views

Actually VS2013 C++ compiles it, but not correctly in access aspect. I have posted bug about that at microsoft: https://connect.microsoft.com/VisualStudio/feedback/details/868971/torino-private-explicitly-default... . May be they are related.

Reply