Skip to content
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

array: Fix structured bindings #73

Merged
merged 3 commits into from
Aug 13, 2024
Merged

Conversation

ishan-karmakar
Copy link
Contributor

Moves all get overloads for frg::array to frg namespace as Clang and GCC expect get to be in inner type's namespace. More info here in Case 2.

@ArsenArsen
Copy link
Member

ArsenArsen commented Aug 12, 2024

hmm, the get invocation should undergo ADL, though, per [dcl.struct.bind]#5, odd that it doesn't.

please add a testcase also

(unrelated, maybe we should start phasing out frg::array and other stuff overlapping with std that is available for freestanding in favor of freestanding - libstdc++ contains quite a few things in freestanding also, and I hope to add to that set this year)

@ArsenArsen
Copy link
Member

ArsenArsen commented Aug 12, 2024

oh, sorry, I read your patch backwards - that explains it :-)

in that case, this looks OK (but perhaps we should keep both functions for BW compatibility, and we should still add a test)

@ishan-karmakar
Copy link
Contributor Author

I added a testcase for frg::array but I didn't add a reference test since arrays of references are illegal. I tried to add the get overloads back to the std namespace for bw compatibility, but an error is thrown since the get overload is ambiguous between frg and std namespace.

(btw, I agree that frg::array should be phased out as it is identical to std::array)

Copy link
Member

@ArsenArsen ArsenArsen left a comment

Choose a reason for hiding this comment

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

nice! thanks

@no92 no92 merged commit edf7b21 into managarm:master Aug 13, 2024
1 check passed
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.

4 participants