the code which trigger this error
FX2CoroutineHandle_Plugin UX2PluginComponent::OnCoroutine0(UX2FunctionWrapper_BeginPlay* ThisFunction, int V0)
{
X2_LOG(X2PluginTemplate, Display, TEXT("DI1211, 09060826, V0"))
bool V1R = co_await OnCoroutine1(ThisFunction, V0 * 10 + 0);
// co_return V1R;
co_return V1R;
}
and another simliliar version
FX2CoroutineHandle_Plugin UX2PluginComponent::OnCoroutine0(UX2FunctionWrapper_BeginPlay* ThisFunction, int V0)
{
X2_LOG(X2PluginTemplate, Display, TEXT("DI1211, 09060826, V0"))
co_return co_await OnCoroutine1(ThisFunction, V0 * 10 + 0);
}
both version will trigger this error.
OnCoroutine1 Definition:
FX2CoroutineHandle_Plugin UX2PluginComponent::OnCoroutine1(UX2FunctionWrapper_BeginPlay* ThisFunction, int V1)
{
X2_LOG(X2PluginTemplate, Display, TEXT("DI1211, 09060826, V1"))
// auto&& V2R = co_await OnCoroutine2(ThisFunction, V1 * 10 + 1);
// co_return V2R;
co_return false;
}
UE5.3.2 Visual Studio tool chain 14.38.33145
FX2CoroutineHandle_Plugin definition:
struct FX2CoroutineHandle_Plugin : std::coroutine_handle<FX2CoroutinePromise_Plugin>
{
using promise_type = FX2CoroutinePromise_Plugin;
bool await_resume();
bool await_ready();
bool await_suspend(std::coroutine_handle<> Coroutine);
};
bool FX2CoroutineHandle_Plugin::await_resume()
{
return promise().ReturnValue;
}
bool FX2CoroutineHandle_Plugin::await_ready()
{
return false;
}
bool FX2CoroutineHandle_Plugin::await_suspend(std::coroutine_handle<> Coroutine)
{
return false;
}
FX2CoroutinePromise_Plugin definition
struct FX2CoroutinePromise_Plugin
{
bool ReturnValue = false;
FX2CoroutineHandle_Plugin get_return_object();
std::suspend_never initial_suspend() noexcept;
std::suspend_never final_suspend() noexcept;
void return_value(bool InValue);
void unhandled_exception();
};
FX2CoroutineHandle_Plugin FX2CoroutinePromise_Plugin::get_return_object()
{
return {
std::coroutine_handle<FX2CoroutinePromise_Plugin>::from_promise(*this)
};
}
std::suspend_never FX2CoroutinePromise_Plugin::initial_suspend() noexcept
{
return std::suspend_never {
};
}
std::suspend_never FX2CoroutinePromise_Plugin::final_suspend() noexcept
{
return std::suspend_never {
};
}
void FX2CoroutinePromise_Plugin::return_value(bool InValue)
{
ReturnValue = InValue;
}
void FX2CoroutinePromise_Plugin::unhandled_exception()
{
}
this is a compile error, there is no need to run any code.
i have changed all the tool chain versions as 14.44 14.42 14.40 14.38 14.37 14.36, since google ai told me that this is the compiler’s error, what i can do is changing and testing new version of compiler.
but without any result, sadly.
to make it clear, i have 100% sure that this error happened because co_return a result of a co_await. if i just co_return false, compile will success.
i’m not so sure what’s wrong, anyone help?
is it hard to migrate ue5.3.2 to ue5.4.4, maybe ue5.4.4 have already solved this problem?
this is the compile log
CONSOLE: C:\Program Files\Epic Games\UE_5.3\Engine\Build\BatchFiles\Build.bat X2PluginsEditor Win64 Development -Project="C:\Users\liutiantian\Desktop\X2Plugins\X2Plugins.uproject" -WaitMutex -FromMSBuild
0>Using bundled DotNet SDK version: 6.0.302
0>Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" X2PluginsEditor Win64 Development -Project="C:\Users\liutiantian\Desktop\X2Plugins\X2Plugins.uproject" -WaitMutex -FromMSBuild
0>Log file: C:\Users\liutiantian\AppData\Local\UnrealBuildTool\Log.txt
0>Building X2PluginsEditor...
0>Using Visual Studio 2022 14.38.33145 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
0>Determining max actions to execute in parallel (10 physical cores, 16 logical cores)
0> Executing up to 10 processes, one per physical core
0> Requested 1.5 GB memory per action, 11.14 GB available: limiting max parallel actions to 7
0>------ Building 4 action(s) started ------
0>[1/4] Compile [x64] Module.X2Base.32.cpp
0>X2PluginComponent.cpp(350): Error C1001 : Internal compiler error.
0>(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c', line 234)
0> To work around this problem, try simplifying or changing the program near the locations listed above.
0>If possible please provide a repro here: https://developercommunity.visualstudio.com
0>Please choose the Technical Support command on the Visual C++
0> Help menu, or open the Technical Support help file for more information
0> cl!RaiseException()+0x8a
0> cl!RaiseException()+0x8a
0> cl!CloseTypeServerPDB()+0x991fb
0> cl!CloseTypeServerPDB()+0xfe410
0>Total time in Parallel executor: 12.97 seconds
0>Total execution time: 13.83 seconds