The following code should compile. With gcc 4.3 it does not. template<typename Iter> struct match_context { }; template<typename BidIter> struct match_state { typedef match_context<BidIter> match_context; };
No, the error message is correct. You change the meaning of match_context in the class. Doing: typedef ::match_context<BidIter> match_context; Fixes the source to be valid C++. Note C++ does not really require a diagnostic here (it is one of the invalid code that C++ does not require one).
Yep, thanks. According to Doug Gregor, this case is covered in the first para of [basic.scope.class]. My bad.