Skip to content

[clang-doc] template operator T() produces a bad name #59812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danakj opened this issue Jan 4, 2023 · 0 comments · May be fixed by #140856
Open

[clang-doc] template operator T() produces a bad name #59812

danakj opened this issue Jan 4, 2023 · 0 comments · May be fixed by #140856
Assignees

Comments

@danakj
Copy link
Contributor

danakj commented Jan 4, 2023

This operator:

  template <SignedPrimitiveInteger U>
    requires(::sus::mem::size_of<U>() >= ::sus::mem::size_of<PrimitiveT>())
  constexpr inline explicit operator U() const {
    return primitive_value;
  }              

Produces this docs:

operator type-parameter-0-0
public U operator type-parameter-0-0()

Which could be greatly improved by just saying "conversion operator to type U. But should also include the concept SignedPrimitiveInteger as the conversion is only valid to a matching type.

@evelez7 evelez7 self-assigned this May 21, 2025
evelez7 added a commit to evelez7/llvm-project that referenced this issue May 21, 2025
Fixes llvm#59812

The names of conversion functions of template type parameters were
being emitted as "type-parameter-N-M". Now we check if the conversion
type is a TemplateTypeParmType and reconstruct the source name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants