Skip to content

[cpyrt] Rank standard conversions above implicit construction - #127

Merged
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:enum-standard-conversions
Oct 1, 2026
Merged

aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:enum-standard-conversions

Conversation

@aaronj0

@aaronj0 aaronj0 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

#75 defers enum instances out of the exact round for integer parameters so that an enum overload wins over an integer one. Two cases regress: an implicit construction from the argument runs under kNoImplicit, where the deferred enum -> int step is refused (RooFit::LineColor(kRed) with a TColorNumber(Int_t) parameter), and in the implicit round a class overload constructible from an int-like object is tried before the integer one (TStyle::SetPalette(kGreyScale) picks the TString overload). Let enum instances through the integer gate under kNoImplicit, and resolve overloads in three stages as C++ ranks them: exact matches, standard conversions (kNoImplicit), implicit conversions.

compiler-research#75 defers enum instances out of the exact round for integer parameters
so that an enum overload wins over an integer one. Two cases regress: an
implicit construction from the argument runs under kNoImplicit, where the
deferred enum -> int step is refused (RooFit::LineColor(kRed) with a
TColorNumber(Int_t) parameter), and in the implicit round a class overload
constructible from an int-like object is tried before the integer one
(TStyle::SetPalette(kGreyScale) picks the TString overload). Let enum
instances through the integer gate under kNoImplicit, and resolve
overloads in three stages as C++ ranks them: exact matches, standard
conversions (kNoImplicit), implicit conversions.
@aaronj0
aaronj0 requested a review from guitargeek October 1, 2026 09:32

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for following up on this

@aaronj0
aaronj0 merged commit 618dc66 into compiler-research:main Oct 1, 2026
25 checks passed
@aaronj0
aaronj0 deleted the enum-standard-conversions branch October 1, 2026 10:40
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