folly icon indicating copy to clipboard operation
folly copied to clipboard

Compile error in folly\test\ExpectedCoroutinesTest.cpp when compiling with /std:c++20 or later

Open NEIL-smtg opened this issue 10 months ago • 0 comments

Hi, I work on Microsoft Visual C++ testing, where we regularly build popular open-source projects, including Folly, with development builds of our compiler and libraries with some particular cl options such as /std:c++20 or later.

Feel free to close this issue if there is no plan of supporting /std:c++20 or later in the future.

As I build Folly from source with /std:c++20 or later, I encountered the following error:

facebook\folly\folly\test\ExpectedCoroutinesTest.cpp(140): error C2059: syntax error: '{'
facebook\folly\folly\test\ExpectedCoroutinesTest.cpp(140): error C2143: syntax error: missing ';' before '{'
facebook\folly\folly\test\ExpectedCoroutinesTest.cpp(140): error C2059: syntax error: ')'

Repro Step:

  1. Open x64 native tools command prompt for VS2022
  2. git clone https://github.com/facebook/folly.git
  3. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64 & set _CL_=/DGLOG_NO_ABBREVIATED_SEVERITIES /DNOMINMAX /DGLOG_USE_GLOG_EXPORT /std:c++latest /utf-8
  4. mkdir facebook\folly\build_amd64 & cd facebook\folly\build_amd64
  5. cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:\gitP\Microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=RELEASE ..
  6. ninja -v

Full build log: folly.txt

NEIL-smtg avatar Feb 17 '25 03:02 NEIL-smtg