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

Outcome failed to build due to error C2230 C7568 C2955 C2057 on windows with MSVC #253

Closed spacelg closed 3 years ago

spacelg commented 3 years ago

Hi All,

Outcome failed to build due to error C2230 C7568 C2955 C2057 on windows with MSVC, this issue can be reproduced on latest version ned14/outcome@9f57231, can you help look?

Repro steps:

  1. git clone --recursive https://github.com/ned14/outcome.git Outcome
  2. Apply outcome_coroutine_lower_workaround.patch and outcome_quickcpplib.patch
  3. mkdir outcome\build_amd64 && cd outcome\build_amd64
  4. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 .. > cmake.log
  5. set CL=/D_HAS_DEPRECATED_IS_LITERAL_TYPE=1 /D_SILENCE_CXX17_IS_LITERAL_TYPE_DEPRECATION_WARNING /Zc:rewrittenExpressions- /Zc:externC-
  6. msbuild /m /p:Platform=x64 /p:Configuration=Release ALL_BUILD.vcxproj /t:Rebuild

Patch file: patch_file.zip

Build log: build.log

Error info: 27>F:\gitP\ned14\outcome\test\tests../../include/outcome.hpp(32,34): error C2230: could not find module 'outcome_v2_9f572317' [F:\gitP\ned14\outcome\build_amd64\outcome_hl--constexpr.vcxproj] 27>F:\gitP\ned14\outcome\test\tests\constexpr.cpp(49,33): error C7568: argument list missing after assumed function template 'result' [F:\gitP\ned14\outcome\build_amd64\outcome_hl--constexpr.vcxproj] 27>F:\gitP\ned14\outcome\test\tests\constexpr.cpp(49,59): error C2955: 'is_literal_type': use of class template requires template argument list [F:\gitP\ned14\outcome\build_amd64\outcome_hl--constexpr.vcxproj] 27>F:\gitP\ned14\outcome\test\tests\constexpr.cpp(49,59): error C2057: expected constant expression [F:\gitP\ned14\outcome\build_amd64\outcome_hl--constexpr.vcxproj] 27>F:\gitP\ned14\outcome\test\tests\constexpr.cpp(50,33): error C7568: argument list missing after assumed function template 'outcome' [F:\gitP\ned14\outcome\build_amd64\outcome_hl--constexpr.vcxproj]

ned14 commented 3 years ago

I think this failure only appears if C++ 20 is enabled. C++ Modules still don't work for Outcome, so I'm minded to flip the default for C++ 20 to disabled by default, opt-in enable. Sound good?

spacelg commented 3 years ago

@ned14 Thanks for your message, sorry for the late reply. Flip the default for C++ 20 to disabled by default sounds good. So that we can successfully build the outcome in our default mode.

Thanks, Lin

ned14 commented 3 years ago

Fixed! Thanks for the BR!