Use _LIBCPP_DEBUG_ASSERT in <list>
Details
- Reviewers
• Quuxplusone ldionne Mordante - Group Reviewers
Restricted Project - Commits
- rG2154dbaa593d: [libc++][NFC] Use _LIBCPP_DEBUG_ASSERT in <list>
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM once my comment on lines 2007–2008 is addressed. Thanks, this is good cleanup!
libcxx/include/list | ||
---|---|---|
1435–1436 | I just wanted to call out that personally I dislike the old code's style of breaking a string literal randomly in the middle, because it means that if I get that error message and grep to find where it was generated — git grep 'iterator not referring to this list' — I would have gotten no results. Putting the message all on one line like you just did is the Right Way because it is greppable. :) | |
1973 | Consider leaving this string message (all in one literal but) on the next line. I.e. don't change lines 2007–2008 at all, I think is what I'm saying, right? | |
2063 | Consider s/_LIBCPP_ASSERT/_LIBCPP_DEBUG_ASSERT/ on this line. IIUC, the change should have no effect, because this entire loop is guarded under _LIBCPP_DEBUG_LEVEL == 2 already; but it would be more self-documenting — this is still a "debug-mode assertion", with all the connotations of _LIBCPP_DEBUG_ASSERT rather than whatever is connoted by a plain _LIBCPP_ASSERT. |
I just wanted to call out that personally I dislike the old code's style of breaking a string literal randomly in the middle, because it means that if I get that error message and grep to find where it was generated — git grep 'iterator not referring to this list' — I would have gotten no results. Putting the message all on one line like you just did is the Right Way because it is greppable. :)