Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/lib/Support/LegibleNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ class LegibleNames::Impl
return getUnnamedInfoName(t);
}
}
else if constexpr(T::isUsing())
{
if (t.Class == UsingClass::Normal && !t.ShadowDeclarations.empty())
{
return getRawUnqualified(t.ShadowDeclarations.front());
}
}
return t.Name;
});
}
Expand Down
156 changes: 156 additions & 0 deletions test-files/golden-tests/symbols/using/using-member-conversion.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
= Reference
:mrdocs:

[#index]
== Global namespace

=== Types

[cols=2]
|===
| Name
| Description
| link:#X[`X`]
| This struct will be inherited as public
| link:#Y[`Y`]
| This struct inherits from X
| link:#fun_ptr[`fun_ptr`]
| A pointer to function typedef
|===

[#fun_ptr]
== fun_ptr

A pointer to function typedef

=== Synopsis

Declared in `<using‐member‐conversion.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using fun_ptr = void(*)();
----

[#X]
== X

This struct will be inherited as public

=== Synopsis

Declared in `<using‐member‐conversion.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct X;
----

=== Member Functions

[cols=2]
|===
| Name
| Description
| link:#X-2conversion[`operator fun_ptr`]
| Conversion operator to function pointer.
|===

=== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#Y[`Y`]
| This struct inherits from X
|===

[#X-2conversion]
== link:#X[X]::operator link:#fun_ptr[fun_ptr]

Conversion operator to function pointer.

=== Synopsis

Declared in `<using‐member‐conversion.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#fun_ptr[fun_ptr]() const;
----

=== Return Value

A pointer to function typedef

[#Y]
== Y

This struct inherits from X

=== Synopsis

Declared in `<using‐member‐conversion.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Y
: link:#X[X]
----

=== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#X[X]`
| This struct will be inherited as public
|===

=== Member Functions

[cols=2]
|===
| Name
| Description
| link:#X-2conversion[`operator fun_ptr`]
| Conversion operator to function pointer.
|===

=== Using Declarations

[cols=2]
|===
| Name
| Description
| link:#Y-2conversion[`operator void(*)()`]
| Bring X::operator fun_ptr into Y.
|===

[#Y-2conversion]
== link:#Y[Y]::operator void(*)()

Bring X::operator fun_ptr into Y.

=== Synopsis

Declared in `<using‐member‐conversion.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using X::operator void(*)();
----

=== Introduced Symbols

[cols=2]
|===
| Name
| Description
| link:#X-2conversion[X::operator fun_ptr]
| Conversion operator to function pointer.
|===

[.small]#Created with https://www.mrdocs.com[MrDocs]#
16 changes: 16 additions & 0 deletions test-files/golden-tests/symbols/using/using-member-conversion.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// A pointer to function typedef
using fun_ptr = void (*)();

/// This struct will be inherited as public
struct X
{
/// Conversion operator to function pointer.
operator fun_ptr() const;
};

/// This struct inherits from X
struct Y : X
{
/// Bring X::operator fun_ptr into Y.
using X::operator fun_ptr;
};
Loading
Loading