Skip to content

Mangle a conversion function's target type once - #433

Open
philipcraig wants to merge 1 commit into
mainfrom
conversion-mangling-429
Open

philipcraig wants to merge 1 commit into
mainfrom
conversion-mangling-429

Conversation

@philipcraig

Copy link
Copy Markdown
Collaborator

Closes #429.

mangle() no longer appends the return type for a conversion function, whose cv<type> atom already carries it, as in Itanium. operator bool() const becomes fn_NKcvbE (was fn_NKcvbEb), and a std::string target is mangled once.

Other functions keep their return type. The header documents it as what keeps get() const on two interfaces apart when they differ only in return type, and DistinguishesMembersDifferingOnlyByReturnType pins that, so dropping it everywhere is a separate decision.

The "unsupported parameter type" error becomes "unsupported type", since it also fires for a conversion target.

A conversion function's name atom is cv<type>, so appending the return
type repeated the target. Omit the return type for conversion functions,
as Itanium does. Other functions keep it.

Reword the unsupported-type error, which also fires for a conversion
target and not only for a parameter.
@philipcraig
philipcraig marked this pull request as ready for review September 18, 2026 22:27
@philipcraig
philipcraig requested a review from jbcoe as a code owner September 18, 2026 22:27
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.23%. Comparing base (c98c808) to head (5ae5cbc).

Files with missing lines Patch % Lines
name_mangling.hh 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #433      +/-   ##
==========================================
+ Coverage   81.21%   81.23%   +0.01%     
==========================================
  Files          16       16              
  Lines        1299     1300       +1     
  Branches      214      214              
==========================================
+ Hits         1055     1056       +1     
  Misses         45       45              
  Partials      199      199              
Flag Coverage Δ
consteval 90.08% <50.00%> (+0.04%) ⬆️
runtime 79.30% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jbcoe jbcoe left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for this.

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.

Conversion functions mangle their target type twice

2 participants