hokein commandeered this revision. hokein edited reviewers, added: sammccall; removed: hokein. hokein added inline comments.
================ Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:333 + // Walk over tokens at the appropriate bracket nesting level. + for (const Token *T = &P.Tokens.tokens()[P.Begin].next(); T->Kind != tok::eof; + T = &T->next()) { ---------------- `P.Tokens.tokens()[P.Begin].next()` doesn't seem like correct, we should start with `P.Tokens.tokens()[P.Begin]`, otherwise we will ignore the first token, example: ``` namespace XXXX { } foo foo; ``` ================ Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:342 + "How did we parse an unmatched closing bracket?!"); + return P.Tokens.index(*T); + } ---------------- we should return `index() +1` ================ Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:347 + P.Tokens.index(*B) >= P.Cursor) + return P.Tokens.index(*B); + // Skip over opening/closing bracket pair. ---------------- the same, +1. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130460/new/ https://reviews.llvm.org/D130460 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits