zinovy.nis marked an inline comment as done. zinovy.nis added inline comments.
================ Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-use-after-move.cpp:329 // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here + // CHECK-NOTES: [[@LINE-6]]:7: note: std::move of the const expression {{.*}} }; ---------------- Quuxplusone wrote: > It continues to seem silly to me that you give an extra note here saying that > line 325 doesn't do anything, when of course line 336 doesn't do anything > either (and you don't give any extra note there). > > This clang-tidy warning isn't supposed to be about what //physically > happens// in the machine code during any particular compilation run; it's > supposed to be about helping the user avoid //semantic// bugs by cleaning up > their codebase's //logical// behavior. The rule is "don't use things after > moving from them," period. > > Analogously, if there were a clang-tidy warning to say "always indent four > spaces after an `if`," and you proposed to add a note to some cases that said > "...but here a three-space indent is OK, because C++ is > whitespace-insensitive" — I'd also find //that// note to be mildly > objectionable. We want to train people to do the right thing, not to do the > right thing "except in this case because hey, it doesn't matter to the > machine." Thanks for the feedback. I got your point. But my note (may be expressed with wrong words) is about that there're 2 ways to fix the issue: either get rid of 'std::move' or somehow remove 'const'. That was the main purpose of my commit. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits