Home Dashboard Directory Help
Search

Random errors caused by syntax error by Asylum2010


Status: 

Closed
 as Deferred Help for as Deferred


1
0
Sign in
to vote
Type: Bug
ID: 772089
Opened: 11/24/2012 8:08:41 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description


// The following program generates random errors in STL headers,
// or even internal compiler error.

// The problem is caused by not putting pharenteses after the destructor call.

#include <iostream>

template <typename T>
class myvector
{
private:
    T*        mydata;
    size_t    mysize;

public:
    void pop_back()
    {
        --mysize;
        (mydata + mysize)->~T;    // <--- here's the error
    }
};

int main()
{
    myvector<int> v1;

    v1.pop_back();

    system("pause");
    return 0;
}
Details
Sign in to post a comment.
Posted by Microsoft on 11/25/2012 at 8:22 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 11/24/2012 at 8:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.