Hi
We use a custom enum macro and Visual Assist gets the coloring wrong and incorrectly shows error squiggles. You can see the incorrect coloring in the switch statement where MyEnumType::VALUE1 and MyEnumType::VALUE2 are used. Those values also show the incorrect error squiggles.
Example Code:
#include <iostream>
#define ENUM(type, first, ...) struct EnumType##Info { enum EnumType { Start, first = 0, __VA_ARGS__, End, Count = End - Start }; };typedef Enum<EnumType##Info> type;
template<typename EnumInfo>
struct Enum : public EnumInfo
{
typedef typename EnumInfo::EnumType EnumType;
EnumType m_value;
Enum() : m_value(EnumInfo::Start) {}
Enum(EnumType value) : m_value(value) {}
operator int() const { return int(m_value); }
};
ENUM(MyEnumType, VALUE0, VALUE1, VALUE2);
int main()
{
MyEnumType x = MyEnumType::VALUE1;
switch (x)
{
case MyEnumType::VALUE0:
std::cout << "VALUE0" << std::endl;
break;
case MyEnumType::VALUE1:
std::cout << "VALUE1" << std::endl;
break;
case MyEnumType::VALUE2:
std::cout << "VALUE2" << std::endl;
break;
}
}
Visual Assist Info:
License: Suede (100-user license) Support ends 2018.04.06
VA_X.dll file version 10.9.2217.0 built 2017.04.26
DevEnv.exe version 15.0.26403.7 Enterprise
msenv.dll version 15.0.26403.7
Comctl32.dll version 6.10.14393.953
Windows 10 10.0 Build 14393
12 processors (x86-64, WOW64)
Language info: 1252, 0x409