ned14 / outcome

Provides very lightweight outcome<T> and result<T> (non-Boost edition)
https://ned14.github.io/outcome
Other
675 stars 62 forks source link

[VS17.10.1] Test 'outcome_hl--issue0071-fail' failed #300

Closed QuellaZhang closed 2 weeks ago

QuellaZhang commented 3 weeks ago

Hi All,

When we build Outcome source code on VS17.10.1, test 'outcome_hl--issue0071-fail' failed on debug and release mode. Can you take a look?

Build steps:

  1. open x64 VS17.10.1 tools command
  2. git clone https://github.com/ned14/outcome C:\gitP\ned14\outcome
  3. mkdir C:\gitP\ned14\outcome\build_amd64
  4. cd /d C:\gitP\ned14\outcome\build_amd64
  5. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 ..
  6. msbuild /m /p:Platform=x64 /p:Configuration=Release ALL_BUILD.vcxproj /t:Rebuild
  7. ctest --build-config Release --output-on-failure

Error info: The following tests FAILED: 45 - outcome_hl--issue0071-fail (Failed) Errors while running CTest

ned14 commented 3 weeks ago

Is it caused by one of the MSVC workarounds no longer triggering?

I keep those workarounds pinned to MSVC version ranges to encourage you guys to fix your compiler next major release :)

QuellaZhang commented 3 weeks ago

Niall, thanks for pointing this out. BTW, where is the workaround? Did you report the feedback to MSVC? If not, I'll check with the developers.

ned14 commented 3 weeks ago

I took a quick pass there and all the MSVC workarounds appear to be pre-VS2022 from first inspection.

Can you supply the diagnostics you get? I'll be honest: I recently left Windows, so I would have to install a VM just for Windows which would be a pain.

QuellaZhang commented 3 weeks ago

It looks like there is a compilation error.

Test log: Test.log

C:\gitP\ned14\outcome\build_amd64>ctest --build-config Release --output-on-failure -R "outcome_hl--issue0071-fail"
Test project C:/gitP/ned14/outcome/build_amd64
    Start 45: outcome_hl--issue0071-fail
1/1 Test #45: outcome_hl--issue0071-fail .......***Failed  Required regular expression not found. Regex=[(error: no matching function for call to .+::basic_result|error: no matching constructor for initialization of 'result<udt>'|cannot convert argument 1 from 'int')
]  1.36 sec
MSBuild version 17.10.4+10fbfbf2e for .NET Framework

  issue0071-fail.cpp
C:\gitP\ned14\outcome\test\compile-fail\issue0071-fail.cpp(35,16): error C2665: 'outcome_v2::basic_result<main::udt,std::error_code,outcome_v2::policy::error_code_throw_as_system_error<R,S,void>>::basic_result': no overloaded function could convert all the argument types [C:\gitP\ned14\outcome\build_amd64\outcome_hl--issue0071-fail.vcxproj]
C:\gitP\ned14\outcome\test\compile-fail\issue0071-fail.cpp(35,16): error C2665:         with [C:\gitP\ned14\outcome\build_amd64\outcome_hl--issue0071-fail.vcxproj]
C:\gitP\ned14\outcome\test\compile-fail\issue0071-fail.cpp(35,16): error C2665:         [ [C:\gitP\ned14\outcome\build_amd64\outcome_hl--issue0071-fail.vcxproj]
C:\gitP\ned14\outcome\test\compile-fail\issue0071-fail.cpp(35,16): error C2665:             R=main::udt, [C:\gitP\ned14\outcome\build_amd64\outcome_hl--issue0071-fail.vcxproj]
C:\gitP\ned14\outcome\test\compile-fail\issue0071-fail.cpp(35,16): error C2665:             S=std::error_code [C:\gitP\ned14\outcome\build_amd64\outcome_hl--issue0071-fail.vcxproj]
C:\gitP\ned14\outcome\test\compile-fail\issue0071-fail.cpp(35,16): error C2665:         ] [C:\gitP\ned14\outcome\build_amd64\outcome_hl--issue0071-fail.vcxproj]

0% tests passed, 1 tests failed out of 1
Total Test time (real) =   1.38 sec

The following tests FAILED:
         45 - outcome_hl--issue0071-fail (Failed)
Errors while running CTest
ned14 commented 2 weeks ago

Try this commit.

QuellaZhang commented 2 weeks ago

@ned14 Thank you, I verified this issue has been fixed!

ned14 commented 2 weeks ago

Excellent. Thanks for reporting it!