Random errors caused by syntax error - by Asylum2010

Status : 

  Deferred<br /><br />
		The product team has reviewed this issue and has deferred it for consideration at a later time.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 772089 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/24/2012 8:08:41 AM
Access Restriction Public

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;
}
Sign in to post a comment.
Posted by Helen [MSFT] 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 Macy [MSFT] 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)