Community
Participate
Working Groups
For the following code: template <typename> struct base { typedef int type; }; template <typename A, typename B> struct derived; template <typename B> struct derived<int, B> : public base<B> { typedef typename derived::type type; // ERROR HERE }; The parser gives an error "Type 'derived::type' could not be resolved" at the indicated line. The error goes away if I provide a definition for the main "derived" template. I believe this is valid code, because inside the "derived<int, B>" specialization, "derived" is short for "derived<int, B>". The code compiles with GCC, clang, and Comeau.
You are right, the parser fails to detect the shorthand notation within the qualified name. Added testcase and fix.