KEMBAR78
`vector_algorithms.cpp`: Improve conformance by adding missing `template` and `typename` for dependent things by AlexGuteniev · Pull Request #5743 · microsoft/STL · GitHub
Skip to content

Conversation

@AlexGuteniev
Copy link
Contributor

Found by compiling with clang-cl stl\src\vector_algorithms.cpp -std:c++latest -march=x86-64-v3.

Whereas we don't build STL with that, there are still reason why compiling this particular file with clang-cl may be useful:

  • Catch instructions not available on a particular arch. If -march=x86-64-v3 is dropped, there would be a lot of target errors, that are solved by placing gnu::target attributes. When they are placed expectedly, unexpected instruction on an unverified properly code path will trigger an error.
  • Run with -fsanitize=undefined to avoid any UB.
  • Conformance by itself is good.

@AlexGuteniev AlexGuteniev force-pushed the vector-clang-conformance branch from 1c108a7 to 7cfff9e Compare September 26, 2025 10:54
@AlexGuteniev
Copy link
Contributor Author

Thanks WG21-P0634R3 for making this only mildly annoying!

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Sep 26, 2025
@StephanTLavavej
Copy link
Member

I'm surprised that MSVC doesn't enforce these in strict mode - I think it'd be worth reporting a DevCom bug.

@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Sep 26, 2025
@AlexGuteniev
Copy link
Contributor Author

I think it'd be worth reporting a DevCom bug.

DevCom-540547

Reported in 2019

a7brk3

@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Oct 3, 2025
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit 747eb50 into microsoft:main Oct 4, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Oct 4, 2025
@StephanTLavavej
Copy link
Member

Thanks for cleaning up all the broken glass from where MSVC let us be bad kitties, jumping up on the table where we're not allowed and batting objects off! 😹 🐈 💥

@AlexGuteniev AlexGuteniev deleted the vector-clang-conformance branch October 4, 2025 05:08
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

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants