Skip to content

mrbind: pass -Wno-enum-constexpr-conversion only to old Clang (18, 19)#6325

Merged
Fedr merged 1 commit into
masterfrom
mrbind-enum-constexpr-old-clang
Jun 25, 2026
Merged

mrbind: pass -Wno-enum-constexpr-conversion only to old Clang (18, 19)#6325
Fedr merged 1 commit into
masterfrom
mrbind-enum-constexpr-old-clang

Conversation

@Fedr

@Fedr Fedr commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Extracted from #4750.

-Wno-enum-constexpr-conversion is only needed by the older Clang versions we use as parsers, so it shouldn't be passed unconditionally. This moves it out of the always-on common_compiler_parser_flags.txt and adds it in generate.mk only when CXX_FOR_BINDINGS reports Clang 18 or 19:

ifneq ($(filter 18 19,$(call safe_shell,$(CXX_FOR_BINDINGS) -dumpversion | cut -d. -f1)),)
COMPILER_FLAGS += -Wno-enum-constexpr-conversion
endif

This mirrors how the neighboring -frelaxed-template-template-args is already gated to older Clang.

Scope note

The original change in #4750 also moved -frelaxed-template-template-args. That flag is already handled on master (added conditionally via clang --help), so this PR touches only -Wno-enum-constexpr-conversion.

It does mean the flag is no longer passed to the Clang 21 (Linux vcpkg) and Clang 22 (macOS / Windows) binding builds — CI on those platforms confirms they still build without it.

This flag is only needed by the older Clang versions we use as parsers, so
move it out of the always-on common_compiler_parser_flags.txt and add it
conditionally in generate.mk, only when CXX_FOR_BINDINGS is Clang 18 or 19.
This mirrors how -frelaxed-template-template-args is already gated nearby.
@Fedr Fedr merged commit 337a1aa into master Jun 25, 2026
41 checks passed
@Fedr Fedr deleted the mrbind-enum-constexpr-old-clang branch June 25, 2026 16:14
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.

2 participants