Compiler crashes when using enum class, having overloaded operator, as template argument - by godzy

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 778805 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 2/7/2013 10:50:34 PM
Access Restriction Public

Description

Below code crashes VC2012 Update 1 compiler:

enum class Flag
{
	First = 1,
	Second = 2,
};

Flag operator& (Flag a, Flag b)
{
	return Flag::First;
}

template<int components>
struct Vector
{
	float m_v[components];
};

template<Flag flags>
void Func (Vector<(flags & Flag::Second) == Flag::Second ? 2 : 1> v)
{
}

int wmain(int argc, wchar_t* argv[])
{
	Vector<2> v;
	Func<Flag::Second>(v);
	return 0;
}
Sign in to post a comment.
Posted by Helen [MSFT] on 2/7/2013 at 11:18 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.