hazohelet wrote: > Ouch the inability to comment outside of modified code is going to be painful. > > The changed code being > > ```c++ > unsigned DisplayLineNo = Loc.getPresumedLoc().getLine(); > for (const auto &I : Ranges) { > DisplayLineNo = > std::min(DisplayLineNo, SM.getPresumedLineNumber(I.getBegin())); > } > ``` > > If the range starts before `DisplayLineNo`, it still works. Am I missing > something?
Thanks, that's my point. When I provided an invalid source location, the diagnostics looked like the following. Filename, line/column number and code snippet are not printed. ``` source:7:3: error: no matching function for call to 'func' 7 | func(3, 4, 5); | ^~~~ note: candidate function not viable: expects an lvalue for 3rd argument 1 error generated. ``` When `Loc` is invalid, calling `Loc.getPresumedLoc().getLine()` should cause validness assertion failure in `PresumedLoc::getLine`, so invalid `Loc` seems to be handled elsewhere. https://github.com/llvm/llvm-project/pull/65238 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits