Build fails for C++23 and Libstdc++, missing `std::unexpected_handler`
- Dominant language
- C++
- Stars
- 30.5k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Description
Folly fails to build with c++23 due to the use of std::unexpectedHandler. It seems to be removed by Libstdc++.
```c++
[212/328] Building CXX object folly/CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o
FAILED: folly/CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o
/usr/bin/g++-13 -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK
-DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB
-DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK
-DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK
-DBOOST_THREAD_NO_LIB -DFMT_SHARED -DFOLLY_XLOG_STRIP_PREFIXES=
\"/home/chris/folly_debug:/home/chris/folly_debug/build/linux-gcc-debug\" -DGFLAGS_IS_A_DLL=0
-D_GNU_SOURCE -D_REENTRANT -I/home/chris/folly_debug/folly -I/home/chris/folly_debug/build/
linux-gcc-debug/folly -g -g -Wall -Wextra -std=c++23 -fcoroutines -g -finput-charset=UTF-8
-fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare
-Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wshadow-compatible-local
-Wno-noexcept-type -faligned-new -fopenmp -MD -MT
folly/CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o
-MF folly/CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o.d
-o folly/CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o
-c /home/chris/folly_debug/folly/folly/lang/Exception.cpp
/home/chris/folly_debug/folly/folly/lang/Exception.cpp:107:8:
error: ‘unexpected_handler’ in namespace ‘std’ does not name a type
107 | std::unexpected_handler unexpectedHandler;
| ^~~~~~~~~~~~~~~~~~
[221/328] Building CXX object folly/CMakeFiles/folly_base.dir/folly/json/JSONSchema.cpp.o
```
I tested this on Ubuntu 24.04 with GCC 13.2.0.
Contributor guide
Assessment
This issue has not been assessed yet.