MyDeveloperDay marked an inline comment as done. MyDeveloperDay added inline comments.
================ Comment at: clang/tools/clang-format/ClangFormat.cpp:351 + SourceLocation LineBegin = Sources.translateFileLineCol( + FileEntryPtr.get(), PLoc.getLine() - 1, 0); + SourceLocation NextLineBegin = ---------------- MyDeveloperDay wrote: > klimek wrote: > > This is unexpected: I'd have expected this to be PLoc.getLine() here and > > PLoc.getLine() + 1 below. I'm probably missing something? > This caught me out too, but it kept pulling the next line. So I think it must > be a zero based line as opposed to PesumedLoc which uses line 1 to mean the > first line.. > > but leet me double check. OK this then perhaps is wrong, given the assert.. let me double check what is going on. ``` SourceLocation SourceManager::translateFileLineCol(const FileEntry *SourceFile, unsigned Line, unsigned Col) const { assert(SourceFile && "Null source file!"); assert(Line && Col && "Line and column should start from 1!"); FileID FirstFID = translateFile(SourceFile); return translateLineCol(FirstFID, Line, Col); } ``` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68969/new/ https://reviews.llvm.org/D68969 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits