Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

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

Andrey_K_
Beginner
705 Views

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
705 Views

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

Patrick

View solution in original post

0 Kudos
3 Replies
pbkenned1
Employee
706 Views

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

Patrick

0 Kudos
pbkenned1
Employee
705 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

 

0 Kudos
Andrey_K_
Beginner
705 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-defaulted-destructor-is-accessible . May be they are related.

0 Kudos
Reply