C ++ C1001, когда класс объявленC++

Программы на C++. Форум разработчиков
Ответить Пред. темаСлед. тема
Anonymous
 C ++ C1001, когда класс объявлен

Сообщение Anonymous »

У меня возникает проблема C1001 (внутренняя ошибка компилятора), когда класс объявлен, а не когда он прокомментируется. Скомпилирование следующего кода с < /p>

Код: Выделить всё

cl /std:c++latest /O2 /Oi /fp:fast /Gy /GL /Gw /EHsc /MD /nologo /openmp:experimental /analyze /c -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt" -I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include" "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\modules\std.ixx"
cl /std:c++latest /O2 /Oi /fp:fast /Gy /GL /Gw /EHsc /MD /nologo /openmp:experimental /analyze /c /Wall /WX /wd4514 /wd4619 /wd4242 /wd4820 /wd5031 /wd4625 /wd4365 /wd4668 /wd5026 /wd4626 /wd5027 -I"C:\Program Files\boost\boost_1_82_0" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt" -I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include" def.ixx
cl /std:c++latest /O2 /Oi /fp:fast /Gy /GL /Gw /EHsc /MD /nologo /openmp:experimental /analyze /c /Wall /WX -I"C:\Program Files\MATLAB\R2025a\extern\include" -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt" -I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include" utils.ixx
< /code>
// def.ixx

module;
#include 
#include 

export module def;
import std;

export namespace def
{
using dictionary = std::unordered_map;
using results = std::unordered_map;

class Cache
{
public:
std::unordered_map data;

private:
friend class boost::serialization::access;
template 
auto serialize(Archive &ar, const unsigned int version) -> void
{
ar & data;
}
};
}
< /code>
// utils.ixx

module;
#include 

export module utils;
import std;
import def;

export namespace utils
{
inline auto dictionaryToUnorderedMap(const mxArray *dict) -> def::dictionary
{
def::dictionary res;

// code removed

return res;
}
}
< /code>
leads to
utils.ixx(13): fatal error C1001: Internal compiler error.
(compiler file 'msc1.cpp', line 1589)
To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
utils.ixx(13): note: the template instantiation context (the oldest one first) is
utils.ixx(12): note: see reference to class template instantiation 'std::unordered_map' being compiled
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\unordered_map(61): note: see reference to class template instantiation 'std::_Hash' being compiled
with
[
_Kty=std::basic_string,
_Ty=std::variant,
_Hasher=std::hash,
_Keyeq=std::equal_to,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\xhash(330): note: see reference to class template instantiation 'std::_Umap_traits' being compiled
with
[
_Kty=std::basic_string,
_Ty=std::variant,
_Hasher=std::hash,
_Keyeq=std::equal_to,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\unordered_map(29): note: see reference to class template instantiation 'std::_Uhash_compare' being compiled
with
[
_Kty=std::basic_string,
_Hasher=std::hash,
_Keyeq=std::equal_to
]
INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe'
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
< /code>
However, if one comments out the Cache
класс он компилирует нормально.

Подробнее здесь: https://stackoverflow.com/questions/797 ... s-declared
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C++»