owenpan added inline comments.
================ Comment at: clang/lib/Format/TokenAnnotator.cpp:2368-2376 + // Before token annotation, clang-format will split the declaration into + // multiple lines in the struct, union, class, and enum cases. For instance, + // `struct {int n} &&ptr={};` will be separated as `struct {`, `int n;` and + // `} &&ptr={};`. So, the matching `{` will be NULL, and we can leverage + // this to indicate whether `&&` is a reference operator or not. + if (PrevToken->is(tok::r_brace) && Tok.is(tok::ampamp) && + !PrevToken->MatchingParen) ---------------- Removing it would suffice. ================ Comment at: clang/unittests/Format/FormatTest.cpp:10477 Style); + verifyFormat("bool b = 3 == int{3} && true;"); ---------------- Can you add a similar test in TokenAnnotatorTest.cpp? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131750/new/ https://reviews.llvm.org/D131750 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits