| Summary: | Error involving template partial specializations for pointers | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> |
| Component: | cdt-indexer | 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: | |||
Added testcase and fix. *** cdt git genie on behalf of Markus Schorn ***
Bug 368404: Current instantiation of class template partial specializations.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=1467a456bd822e30ce023b723bf21aecb98798db
*** cdt git genie on behalf of Markus Schorn ***
Bug 368404: Testcase.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=59c4d10629cf7e8567ffb9759022212654c58615
|
test.hpp: template <typename T> struct remove_const_impl {}; template <typename T> struct remove_const_impl<T*> { typedef T type; }; template <typename T> struct remove_const_impl<const T*> { typedef T type; }; template <typename T> struct remove_const { typedef typename remove_const_impl<T*>::type type; }; test.cpp: #include "test.hpp" template<typename Seq> struct foo; template <> struct foo<int> { typedef int type; }; typedef foo<remove_const<const int>::type>::type t; // ERROR HERE The error at the indicated line is: "Type 'foo<remove_const<const int>::type>::type' could not be resolved" The error goes away in the following cases: - contents of test.hpp are pasted into test.cpp - test.cpp calls remove_const<int> instead of remove_const<const int> - test.cpp calls remove_const_impl directly instead of through the remove_const wrapper - remove_const_impl is modified to specialize on T and const T, rather than T* and const T*