Skip to content

Conversation

StephanTLavavej
Copy link
Member

Thanks to C++ MVP Marc Gregoire for reporting that import std; didn't allow <format> machinery to work with /utf-8.

First, this adds test coverage to the Standard Library Modules test. We were already exercising the affected function, we just need to add a /utf-8 configuration to light up the corresponding if constexpr paths.

Second, this adds a product code workaround. As @cdacamar noted, this is internal VSO-1538698 "Better handling for non-exported friend function declarations" again, where granting friendship to templated, non-module-exported (i.e. _Ugly) functions doesn't work.

I've audited the STL and I believe we're consistently applying the workaround now. We just need to remember that friend will trigger this compiler bug.

@StephanTLavavej StephanTLavavej added format C++20/23 format modules C++23 modules, C++20 header units labels Jun 20, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner June 20, 2023 21:39
@MarcGregoire
Copy link

Thanks for the quick reaction!

@StephanTLavavej StephanTLavavej self-assigned this Jun 22, 2023
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit c5f1960 into microsoft:main Jun 22, 2023
@StephanTLavavej StephanTLavavej deleted the modules-friend-or-foe branch June 22, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format C++20/23 format modules C++23 modules, C++20 header units
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants