Community
Participate
Working Groups
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.
There was a similar issue with partial specializations. Added testcases and fix.