Skip to content

fix: conversion functions are named as written - #1263

Open
gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:fix/conversion_operator_names
Open

fix: conversion functions are named as written#1263
gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:fix/conversion_operator_names

Conversation

@gennaroprota

Copy link
Copy Markdown
Collaborator

This fixes an issue for which operator CArray& came out as operator &, operator T::type as operator ::type, and operator fun_ptr as operator void(*)().

The empty names also collided, so conversions to unrelated types were grouped as overloads of each other.

Furthermore, a using-declaration that imports a conversion is named the same way now.

Fixes #1259.

Changes

  • Source: ASTVisitor names a conversion function after the conversion type as written instead of after the DeclarationName.
  • Tests: New fixture tests/golden/fixtures/symbols/function/conv-operator-names.cpp, covering the ways the canonical type differs from the written one.
  • Golden tests: Regenerated two golden fixtures that had recorded the old names (operator instead of operator U and an imported conversion with void(*)() in it, rather than fun_ptr).

Testing

The new fixture is covered by the existing golden suite.

Documentation

No documentation change.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

✨ Highlights

  • 🧪 Existing golden tests changed (behavior likely shifted)

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🥇 Golden Tests 94% 798 792 6 4 2 2 - -
🛠️ Source 6% 49 48 1 2 - 2 - -
Total 100% 847 840 7 6 2 4 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • tests/golden/fixtures/symbols/function/conv-operator-names.xml (Golden Tests): 740 lines Δ (+740 / -0)
  • tests/golden/fixtures/symbols/function/conv-operator-names.cpp (Golden Tests): 46 lines Δ (+46 / -0)
  • src/mrdocs/AST/ASTVisitor.cpp (Source): 45 lines Δ (+44 / -1)

Generated by 🚫 dangerJS against ebde394

This fixes an issue for which `operator CArray&` came out as `operator
&`, `operator T::type` as `operator ::type`, and `operator fun_ptr` as
`operator void(*)()`.

The empty names also collided, so conversions to unrelated types were
grouped as overloads of each other.

Furthermore, a using-declaration that imports a conversion is named the
same way now.

Fixes cppalliance#1259.
@gennaroprota
gennaroprota force-pushed the fix/conversion_operator_names branch from 5dd56dc to ebde394 Compare August 25, 2026 15:16
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.12%. Comparing base (e31308f) to head (ebde394).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1263   +/-   ##
========================================
  Coverage    83.12%   83.12%           
========================================
  Files           35       35           
  Lines         3662     3662           
  Branches       844      844           
========================================
  Hits          3044     3044           
  Misses         410      410           
  Partials       208      208           
Flag Coverage Δ
bootstrap 83.12% <ø> (ø)

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1263.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-08-25 15:23:30 UTC

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 operator are erroneously shown as operator &.

2 participants