[All VС versions] fatal error C1001: INTERNAL COMPILER ERROR
От: Ligen Украина http://zone-of-ambiguity.blogspot.com/
Дата: 26.05.10 11:40
Оценка: 69 (3)
Этот прекрасный код вызывает у микрософтовского компилятора разрыв шаблона:

#include "string"

template<class Type, class ObjectType, template<class> class Traits, template<class> class AllocatorType>
void ToString(const ObjectType & object, std::basic_string<Type, Traits<Type>, AllocatorType<Type> > * pStr)
{
}

template<class Type, template<class> class Traits, template<class> class AllocatorType>
void ToString(int object, std::basic_string<Type, Traits<Type>, AllocatorType<Type> > * pStr)
{
}

int main()
{
    int val = 0;
    std::string str;
    ToString(val, &str);
    return 0;
}

Попробовал на версиях 7.1, 9.0, 10.0, результат один и тот же:

d:\Projects\test\main.cpp(17) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

Самое прекрасное в этом баге то, что если поменять местами в первой функции Type и ObjectType местами, например, так:
template<class ObjectType, class Type, template<class> class Traits, template<class> class AllocatorType>
void ToString(const ObjectType & object, std::basic_string<Type, Traits<Type>, AllocatorType<Type> > * pStr) ..

то он воспроизводиться не будет.
Форму, куда сабмитить баг я вроде бы нашел.
Но у меня возник вопрос, может его уже кто-то сабмитил? можно ли где-то посмотреть список багов на MS С++ компиляторы?


26.05.10 16:56: Перенесено модератором из 'C/C++. Прикладные вопросы' — Кодт
Viva el Junta Militar! Viva el Presidente!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.