Repository navigation
lint: AdlBarrierChecker keeps barrier names out of fl and reachable (#4851) - #4854
Conversation
…4851) New structural pass. Collects every function declared directly in fl::adl_barrier across src/, then fails on (1) any function of the same name declared directly in fl (incl. inline/anonymous namespaces): ADL finds it again and qualified fl::name lookup stops before the barrier, and (2) any barrier function not called as fl::name in adl_barrier.cpp's reachability test case. (2) immediately found fl::equal_container and fl::sort_small uncovered; they are now called there.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Closes #4851. Part of #4844.
src/fl/stl/adl_barrier.hsays put every namespace-scope overload of a barrier name in the barrier, but nothing enforced that rule. This adds a structural lint pass,checkers/adl_barrier.rs:fl::adl_barrieracrosssrc/.fl(inline and anonymous namespaces count) fails. Such an overload is visible to ADL again, so it can tie withstd::, and qualifiedfl::namelookup stops at fl and never reaches the barrier's overloads.fl::namein theevery adl_barrier name is reachable as fl::namecase oftests/fl/stl/adl_barrier.cpp. This is the compile check that qualified lookup still works.The coverage rule immediately found
fl::equal_containerandfl::sort_smalluncovered (the real-tree test failed). Both are now called in that test case.Not flagged (unit tests cover each): calls, class members, sub-namespaces such as
fl::detail, code outsidefl, anddecltype/initializer uses.swapandclampstay directly in fl by design and are not barrier names, so they are not affected.Evidence: 6
adl_barrierchecker tests pass, includingreal_tree_passes.bash test adl_barrierpasses.bash lint: 0.Summary by CodeRabbit