Skip to content

Conversation

travisdowns
Copy link
Contributor

@travisdowns travisdowns commented Oct 22, 2025

After recent changes to memory.cc, it fails to compile as standard
libraries vary in their return value for std::bit_width. Initial C++20
behavior was to return an integer of the same signeness as the input,
but later standards specify an int return type.

This patch changes the variable w to be an int from auto so it
works everywhere.

@travisdowns travisdowns changed the title Fix compile: memory max constant in allocator BUILD FIX: memory max constant in allocator Oct 22, 2025
@travisdowns travisdowns marked this pull request as ready for review October 22, 2025 22:59
@travisdowns
Copy link
Contributor Author

I see, the problem is that https://cplusplus.github.io/LWG/issue3656 changed the return type from same as input to always int, so standard libs in the wild vary. So the right fix is to use int instead of auto.

After recent changes to memory.cc, it fails to compile as standard
libraries vary in their return value for std::bit_width. Initial C++20
behavior was to return an integer of the same signeness as the input,
but later standards specify an `int` return type.

This patch changes the variable `w` to be an `int` from auto so it
works everywhere.
@travisdowns travisdowns force-pushed the td-compile-fix-memory-max branch from 2e00a68 to de13f5e Compare October 23, 2025 01:02
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.

1 participant