It seems to have been a bug in Visual Studio 2013 itself. Curious if anyone with it can confirm on their installations, but it boiled down to in-header initialization of enums causing the debugger to go wonky, indicating probable bad code generation. To replicate, here's the smallest setup:
Create a new Visual C++ General solution empty project. Add a 'main' unit to it, or whatever you want to call it. Paste the following:
#include "Object.h"
#include <iostream>
int main() {
Junk * junk = NULL;
Object o(junk);
int dummy;
std::cout << std::endl << "Press a key and 'Enter' to quit ";
std::cin >> dummy;
return 0;
}
Add an 'Object.cpp' file:
#include "Object.h"
Object::Object(Junk * junk) : junkC(junk) {
}
bool Object::doSomething() {
return true;
}
And an "Object.h"
#pragma once
class Junk;
class Object {
private:
Junk * junkC;
public:
enum Style { ThreeD, Flat, Shadow } containerStyleC = ThreeD;
Object(Junk * junk);
bool doSomething();
};
Put a breakpoint at Object::Object(Junk*)... When it is hit, do a 'step into.' The next line the debugger goes to is the end of the 'doSomething' block.
If the enum initialization is performed in the cpp file's class initialization list, the debugger steps as expected. I tried reporting this through the 'Report a bug' option in VS, but it hasn't appeared yet, although there may have been one step I didn't complete. By the fact it shows I have no submissions, I'm guessing I missed a step, but I'll wait a while and maybe it will appear.