Targets are not necessarily inserted in the order they appear in source
code. For example we could traverse overload sets, or selectively insert
template patterns after all other decls.
So order the targets before printing to make sure tests are not dependent on
such implementation details. We can also do it in production, but that might be
wasteful as we haven't seen any complaints in the wild around these orderings
yet.
Details
Details
- Reviewers
sammccall - Commits
- rGcae932b6c6d3: [clangd] Sort targets before printing for tests
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thanks!
clang-tools-extra/clangd/FindTarget.cpp | ||
---|---|---|
1176 | No real objection to this form, but mutating the (copied) argument is a bit of a WTF. |
No real objection to this form, but mutating the (copied) argument is a bit of a WTF.
An altervative would be to render Targets into an array, sort them (as strings), and then llvm::join them.