This applies a lot to Qt code (Which requires QOBJECT define at the beginning of each Qt class), but here's an independent example:
I craft this test code -
#define STUBBYS TestClass() {} virtual ~TestClass() {}
class TestClass
{
public:
STUBBYS;
int TestFunc() { return 1; }
};
Right-click the class and select "Move method implementations to source file", and strangely 3 functions show up in the list, not one. For grins, just hit okay moving all functions, and this results:
(Header file)
#define STUBBYS TestClass() {} virtual ~TestClass() {}
class TestClass
{
public:
STUBBYS;
int TestFunc();
};
(Source file)
int TestClass::TestFunc()
{
return 1;
}
TestClass::TestClass()
{
}
TestClass::~TestClass()
{
}
Obviously, it should not (and does not have the ability to) move the definitions out of the #define, but it should also not generate duplicate definitions!
I know this example is ... Rather bad code... But it shows the problem.
VA_X.dll file version 10.9.2223.0 built 2017.06.22
DevEnv.exe version 14.0.25420.1 Professional
msenv.dll version 14.0.25425.1