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

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

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

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

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

Patrick

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

 

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/torin... . May be they are related.

Leave a Comment

Please sign in to add a comment. Not a member? Join today