Main.cpp is 282 lines long, the line that it's pointing to is just a closing brace }. Parent() is never called outside the class (so why would it complain about it being protected)? And why would it complain about state_return() calling a protected method, as this is a member of the class. Does GCC/G++ screw up with protected data members in templates? I suspect (and this is just a hunch) it's trying to inline expand the functions like macros... but why?

I knew about the super-call derived (I noticed that about 10 minutes after I posted). However, I didn't know about the derived class not being able to call protected methods on the parent class's instances. So now I have to ask: How should I change my code to conform? The least-bad way I can think of is make the classes mutual friends, which seems to break encapsulation. However, as all the polymorphism should be through the template (i.e. static, not dynamic), it shouldn't harm the use of the class, as state_machine and substate_machine are tightly coupled.
–
Robert MasonFeb 17 '11 at 1:50

This looks like a bug in g++. It should not be checking the access of substate_machine<Data, T>'s constructor because it has a dependent type. The function containing the new-expression might only be instantiated for types where substate_machine is specialized and has a public constructor, so the compiler is not permitted to reject this code.

I cannot find a version of g++ that has this bug; which version are you using?