Skip to content

Conversation

@neundorf
Copy link

This unit test uses "using UEnum = Enum;" and imports that into Carbon.

This is my very first try at contributing something to carbon, I'm looking forward to your feedback.
The test is very basic.
What other cases should it test ?
What other comments do you have ?

This unit test uses "using UEnum = Enum;" and
imports that into Carbon.
@neundorf neundorf requested a review from a team as a code owner October 26, 2025 16:53
@neundorf neundorf requested review from zygoloid and removed request for a team October 26, 2025 16:53
@neundorf
Copy link
Author

The test currently simply tests one using enum on global scope.
Should I add an enum inside a class ? An enum class inside a class ? Other variations ?

@zygoloid
Copy link
Contributor

zygoloid commented Oct 27, 2025

If this is for the "using enum support" item in the toolchain tasks document, that's talking about the C++20 using enum feature:

enum class A { x, y };
// Cannot name `A::x` as simply `x` here.
using enum A;
// Can now name `A::x` as simply `x`.
A a = x;

The using B = A; syntax is an alternative syntax for typedef declarations, and we have tests for that in toolchain/check/testdata/interop/cpp/typedef.carbon already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants