[PATCH] D75364: [clang-format] Handle macros in function params and return value

Tamas Petz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 28 09:38:02 PST 2020


tamas.petz created this revision.
tamas.petz added reviewers: chandlerc, djasper.
tamas.petz added a project: clang-format.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch adds support to handle macros in function parameter list
and function return type.

Consider the following case:

  const ElfW(Addr)* foo(ElfW(Addr)* addr);

This case was handled incorrectly because the star token was
handled as a binary operator. After formatting:

  const ElfW(Addr) * foo(ElfW(Addr) * addr);

This patch adds support for this case.

All format tests pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75364

Files:
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75364.247289.patch
Type: text/x-patch
Size: 6006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200228/ec4d47c8/attachment-0001.bin>


More information about the cfe-commits mailing list