Некорректное поведение Intel Compiler C++
От: LeonCrew Беларусь  
Дата: 22.11.17 17:26
Оценка:
Всем привет!

Столкнулся с некорректным поведением компилятора Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.124 Build 20170811, платформа сборки Windows 10

Минимальный тестовый пример выдает ошибку:

Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.124 Build 20170811
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

ConsoleApplication1.cpp
ConsoleApplication1.cpp(3): error: incomplete type is not allowed
  class TemplateClass : public Base
                               ^
          detected during instantiation of class "TemplateClass<Base> [with Base=SomeClass]" at line 10

compilation aborted for ConsoleApplication1.cpp (code 2)


Сам код:

template <class Base>
class TemplateClass : public Base
{
    char t;
};

class SomeClass
{
    static TemplateClass <SomeClass> StaticMember; // <---  incomplete type is not allowed
};

int main()
{
    SomeClass cls;
    return 0;
}


Код корректно собирается в VS2015/2017, xCode 9. Также проверял на ideone.com и godbolt.org.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.