| Summary: | CDT ignores template specialization in header file | ||
|---|---|---|---|
| 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: | |||
There was a similar issue with partial specializations. Added testcases and fix. |
In the following code, test.hpp forward-declares a template class, and defines a specialization of it; test.cpp then defines the general template. It seems that in this arrangement, CDT ignores the specialization in the header, as indicated by the following error: test.hpp: #ifndef TEST_HPP_ #define TEST_HPP_ template <typename> struct foo; template <> struct foo<int> { typedef int type; }; #endif // TEST_HPP_ test.cpp: #include "test.hpp" template <typename> struct foo { }; int main() { typedef foo<int>::type type; // ERROR HERE: 'foo<int>::type' could not be resolved } The code compiles fine with GCC.