Home Dashboard Directory Help
Search

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


Status: 

Closed
 as Deferred Help for as Deferred


1
0
Sign in
to vote
Type: Bug
ID: 778805
Opened: 2/7/2013 10:50:34 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

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;
}
Details
Sign in to post a comment.
Posted by Microsoft 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.
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
VCBug.zip 2/7/2013 2 KB