Bug #119238 Compilation error with clang 20

Submitted: 27 Oct 2025 7:31 Modified: 9 Jun 13:52
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.45 OS:MacOS (26.0.1)
Assigned to: CPU Architecture:ARM

[27 Oct 2025 7:31] Laurynas Biveinis
Description:
CMake options: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DFORCE_UNSUPPORTED_COMPILER=ON -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DMYSQL_MAINTAINER_MODE=ON -DWITH_SYSTEM_LIBS=ON -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DDOWNLOAD_BOOST=ON -DWITH_BOOST=(path) -DFORCE_COLORED_OUTPUT=ON -DCMAKE_CXX_FLAGS=-g -DCMAKE_CXX_FLAGS_DEBUG=-g -DCMAKE_CXX_FLAGS_RELEASE=-O2 -DNDEBUG -g

with Homebrew-installed LLVM 20 result in

FAILED: [code=1] router/src/harness/src/CMakeFiles/harness_stdx.dir/stdx/filesystem.cc.o
/opt/homebrew/opt/llvm@20/bin/clang++ -DBOOST_NO_CXX98_FUNCTION_BASE -DHAVE_TLSv13 -DLZ4_DISABLE_DEPRECATE_WARNINGS -D_USE_MATH_DEFINES -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Dharness_stdx_EXPORTS -I/Users/laurynas/vilniusdb/mysql-8.0.44/_build-release-llvm-20 -I/Users/laurynas/vilniusdb/mysql-8.0.44/_build-release-llvm-20/include -I/Users/laurynas/vilniusdb/mysql-8.0.44 -I/Users/laurynas/vilniusdb/mysql-8.0.44/include -I/Users/laurynas/vilniusdb/mysql-8.0.44/_build-release-llvm-20/router -I/Users/laurynas/vilniusdb/mysql-8.0.44/_build-release-llvm-20/router/include -I/Users/laurynas/vilniusdb/mysql-8.0.44/router/src/harness/src/../include -I/Users/laurynas/vilniusdb/mysql-8.0.44/router/src/harness/src -I/Users/laurynas/vilniusdb/mysql-8.0.44/_build-release-llvm-20/router/src/harness/src/../include -isystem /Users/laurynas/vilniusdb/mysql-8.0.44/extra/rapidjson/include -isystem /opt/homebrew/opt/openssl@1.1/include -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/editline -isystem /opt/homebrew/include -std=c++17 -fno-omit-frame-pointer -ftls-model=initial-exec -g -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wno-null-conversion -Wno-unused-private-field -Wconditional-uninitialized -Wdeprecated -Wno-deprecated-declarations -Wno-shorten-64-to-32 -Wextra-semi -Wheader-hygiene -Wnon-virtual-dtor -Wundefined-reinterpret-cast -Wrange-loop-analysis -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wshadow-field -Werror -ffunction-sections -fdata-sections -O2 -DNDEBUG -g -arch arm64 -fPIC -fcolor-diagnostics -MD -MT router/src/harness/src/CMakeFiles/harness_stdx.dir/stdx/filesystem.cc.o -MF router/src/harness/src/CMakeFiles/harness_stdx.dir/stdx/filesystem.cc.o.d  --language=c++  -o router/src/harness/src/CMakeFiles/harness_stdx.dir/stdx/filesystem.cc.o -c /Users/laurynas/vilniusdb/mysql-8.0.44/router/src/harness/src/stdx/filesystem.cc
In file included from /Users/laurynas/vilniusdb/mysql-8.0.44/router/src/harness/src/stdx/filesystem.cc:40:
/Users/laurynas/vilniusdb/mysql-8.0.44/router/src/harness/src/../include/mysql/harness/stdx/expected.h:74:8: error: 'is_default_constructible' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization]
   74 | struct is_default_constructible<std::unique_ptr<T, void (*)(T *)>>
      |        ^
/opt/homebrew/Cellar/llvm@20/20.1.8/bin/../include/c++/v1/__type_traits/is_constructible.h:51:29: note: marked 'no_specializations' here
   51 | struct _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS is_default_constructible
      |                             ^
/opt/homebrew/Cellar/llvm@20/20.1.8/bin/../include/c++/v1/__config:1177:9: note: expanded from macro '_LIBCPP_NO_SPECIALIZATIONS'
 1177 |       [[_Clang::__no_specializations__("Users are not allowed to specialize this standard library entity")]]
      |         ^

How to repeat:
See above
[27 Oct 2025 7:50] Laurynas Biveinis
The build completes with -Wno-invalid-specialization
[27 Oct 2025 12:03] Laurynas Biveinis
8.4.7 is not affected
[23 Jan 7:48] Laurynas Biveinis
Same with 8.0.45
[9 Jun 13:52] Laurynas Biveinis
Same with 8.0.46 with current XCode

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.053 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.