http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52458
--- Comment #5 from Alexey Kulentsov <crimaniak at gmail dot com> 2012-03-02 14:49:41 UTC --- (In reply to comment #4) >It works ok if you do the conversion to the base class explicitly: Yes, I just make public inheritance so this problem is non-blocking for me, but this was a bug so I post it. It's pity MinGW updated only to 4.6.2. > I think the range-for code needs to do overload resolution in the class' > scope, > but it fails to and tries to say the begin/end members are protected, then > gets > into trouble while trying to print the error message. Agree. Diagnostics problem.