This is the minimal code needed to duplicate the test case:
\n// file test.cpp\n\n#include <string>\n#include <list>\n\ntemplate <class T>\nclass CTestAlloc\n{\npublic:\n\ttypedef T value_type;\n\ttypedef size_t size_type;\n\ttypedef ptrdiff_t difference_type;\n\ttypedef T * pointer;\n\ttypedef const T * const_pointer;\n\ttypedef T & reference;\n\ttypedef const T & const_reference;\n\n\ttemplate <class U>\n\tstruct rebind { typedef CTestAlloc<U> other; };\n};\n\n\nclass CTest \n{\n\ttypedef std::string string;\n\npublic:\n\tclass Field;\n\tclass Field_iter;\n\n\ttypedef CTestAlloc<Field> FieldAllocator;\n\n\ttypedef std::list<Field,FieldAllocator> Fields_t;\n\n\tclass Field : public string\n\t{\n\t};\n\n\tclass Field_iter : public Fields_t::iterator\n\t{\n\t};\n\npublic:\n\tCTest();\n\tvirtual ~CTest();\n};\n
'gcc -o test.o -c test.cpp' (2.95.4) compiles. 'icc -o test.o -c test.cpp' (7.0) does not. Same code will compile in MSVC 6.0 and gcc 3.2.1 as well.
So, is it a compiler error or an stl implementation error? And how do you put up with this shit?