| Summary: | Parser error involving templates and inheritance | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> |
| Component: | cdt-parser | Assignee: | Markus Schorn <mschorn.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug |
| Version: | 8.1.0 | ||
| Target Milestone: | 8.1.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
You are right, the parser fails to detect the shorthand notation within the qualified name. Added testcase and fix. |
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.