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

Various cleanups: Declare _Meow_vbool to avoid ADL #4151

Merged

Conversation

StephanTLavavej
Copy link
Member

I noticed this a while ago, but it's increasingly important due to modules. (This PR avoids the likely compiler bug VSO-1914077 "Modules: extern "C++" interferes with ADL".)

The vector<bool> algorithm optimizations (#879 #1131 #3353) detect vector<bool> iterators via an internal type trait, then dispatch to dedicated functions. We were defining those functions in <vector>, but were never declaring them before calling them in <xutility> (which is "higher up" in the dependency graph), so our calls were actually using ADL. That was squirrelly 🐿️ since we never rely on ADL like this for internal functions.

This PR adds declarations (dropping const on value parameters as usual), then qualifies the calls for good measure (also aligning with our developing practice of qualifying internal calls, which personally hasn't filled me with delight elsewhere but is definitely reassuring here).

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Nov 7, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner November 7, 2023 15:32
@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 d3873a5 into microsoft:main Nov 10, 2023
37 checks passed
@StephanTLavavej StephanTLavavej deleted the squirrel-dependent-lookup branch November 10, 2023 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants