krasimir added inline comments.
================ Comment at: lib/Format/TokenAnnotator.cpp:1566 - if (PrevToken->is(tok::coloncolon)) + if (PrevToken->isOneOf(tok::coloncolon, tok::kw_const)) return TT_PointerOrReference; ---------------- I'd also check for `volatile` here, for example for (+ add it as test): ``` auto x() volatile& noexcept -> bool {} ``` ================ Comment at: lib/Format/TokenAnnotator.cpp:1590 + tok::kw_typeof, tok::kw_decltype, TT_FunctionDeclarationName, + TT_StartOfName, TT_OverloadedOperator)) return TT_PointerOrReference; ---------------- Sorry, I don't follow which of the added tests exercise which of the added cases. Could you please elaborate? ================ Comment at: unittests/Format/FormatTest.cpp:6164 + verifyGoogleFormat("template <typename T>\n" + "auto operator+() &MACRO {}"); } ---------------- Do you have a real-world example of this kind of macro? I'd leave it off if not. Repository: rC Clang https://reviews.llvm.org/D47519 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits