[PATCH] D79201: [clang-format] : Fix additional pointer alignment for overloaded operators

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 17:13:07 PDT 2020


sammccall added a comment.

Looks OK but covers a lot of cases that can't happen, we should probably not test those at least :-)



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2817
     return false;
-  if (Right.is(tok::star) && Left.is(tok::star))
+  if (Right.isOneOf(tok::star, tok::amp, tok::ampamp) &&
+      Left.isOneOf(tok::star, tok::amp, tok::ampamp))
----------------
Maybe left should only be star and right should be any?

`T &*` isn't a thing as far as I know, there are no pointers to references.
`T && &`, `T & &&` etc don't occur as far as I know (and removing the space would seem dubious!)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79201/new/

https://reviews.llvm.org/D79201





More information about the cfe-commits mailing list