Skip to content

Fix compilation errors on macOS 15 by adding explicit constructors - #35134

Closed
arik-so wants to merge 2 commits into
bitcoin:masterfrom
arik-so:mempool-entry-explicit-constructor
Closed

arik-so wants to merge 2 commits into
bitcoin:masterfrom
arik-so:mempool-entry-explicit-constructor

Conversation

@arik-so

@arik-so arik-so commented Apr 21, 2026

Copy link
Copy Markdown

On macOS 15, with clang version 15.0.0, compilation was failing at mempool.cpp and validation.cpp. Adding explicit constructors to the ConnectedBlock and Entry structs appears to have remedied that.

arik-so added 2 commits April 21, 2026 10:59
The compilation of mempool.cpp was failing on macOS, and
the explicit constructor should remedy that.
The compilation of validation.cpp was failing on macOS, and
the explicit constructor should remedy that.
@DrahtBot

DrahtBot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@arik-so arik-so mentioned this pull request Apr 21, 2026
1 task done
@arik-so

arik-so commented Apr 21, 2026

Copy link
Copy Markdown
Author

I am not 100% sure how to test this specific change. Do you think testing against clang 15 in the CI matrix would do the trick, @fanquake?

@maflcko

maflcko commented Apr 21, 2026

Copy link
Copy Markdown
Member

You'll have to upgrade your XCode, See: https://developer.apple.com/documentation/xcode-release-notes/xcode-16_2-release-notes

E.g.

          sudo xcode-select --switch /Applications/Xcode_16.2.app
      

@arik-so

arik-so commented Apr 21, 2026

Copy link
Copy Markdown
Author

I will certainly be upgrading my Xcode. In the interim, I take it I should abandon this fix for version 15?

@maflcko

maflcko commented Apr 21, 2026

Copy link
Copy Markdown
Member

Yes, I think you are better off with a more recent version of XCode, than trying to modify the source code to work with older XCode versions that aren't tested by anyone (not even the CI).

If upgrading your XCode works, then I think this can be closed.

@arik-so

arik-so commented Apr 21, 2026

Copy link
Copy Markdown
Author

I will report back once I have the upgraded command line tools installed and tested the build.

@arik-so

arik-so commented Apr 21, 2026

Copy link
Copy Markdown
Author

Xcode 16.4 with clang 17.0.0 works.

@arik-so arik-so closed this Apr 21, 2026
@vasild

vasild commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

@arik-so, would be cool if you can test #34580 and post your feedback there.

@arik-so

arik-so commented Apr 25, 2026

Copy link
Copy Markdown
Author

Hi @vasild, I switched back to the old clang version and gave it a try, with the following output:

-- Checking for required C++ features
CMake Error at cmake/module/CheckCXXFeatures.cmake:32 (message):
Compiler lacks Class Template Argument Deduction (CTAD) for aggregates.

This C++ feature is required for src/util/overloaded.h.

You are probably using an old compiler version

The recommended compiler versions can be checked in:

- GCC -> doc/dependencies.md#compiler
- Clang -> doc/dependencies.md#compiler
- MSVC -> doc/build-windows-msvc.md

Call Stack (most recent call first):
CMakeLists.txt:198 (check_cxx_features)

-- Configuring incomplete, errors occurred!
-- Checking for required C++ features
CMake Error at cmake/module/CheckCXXFeatures.cmake:32 (message):
Compiler lacks Class Template Argument Deduction (CTAD) for aggregates.

This C++ feature is required for src/util/overloaded.h.

You are probably using an old compiler version

The recommended compiler versions can be checked in:

- GCC -> doc/dependencies.md#compiler
- Clang -> doc/dependencies.md#compiler
- MSVC -> doc/build-windows-msvc.md

Call Stack (most recent call first):
CMakeLists.txt:198 (check_cxx_features)

-- Configuring incomplete, errors occurred!
make: *** [cmake_check_build_system] Error 1

So looks like the feature checking worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants