Compile error in folly\test\ExpectedCoroutinesTest.cpp when compiling with /std:c++20 or later
- Dominant language
- C++
- Stars
- 30.5k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Description
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:
```c++
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](https://github.com/user-attachments/files/18818112/folly.txt)
Contributor guide
Assessment
This issue has not been assessed yet.