I should've suspected when the compiler issued the error message TWICE for the same line. :)
Thank you; I'll try to workaround it.
---
Edit:
Confirmed - I get the same error (thrice :)
error C2248: 'foo1' : cannot access protected struct declared in class 'foo'
on line 27 of your program,
foo::foo1 foo::foo2::myfunction(void) {
Thanks for crosschecking.