[PATCH] D57184: [clang-format] Allow configuring list of function-like macros that resolve to a type

Marcin Radomski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 24 13:22:17 PST 2019


dextero created this revision.
dextero added reviewers: Typz, krasimir, djasper.
Herald added a subscriber: cfe-commits.

Adds a `TypenameMacros` configuration option that causes certain identifiers to be handled in a way similar to `typeof()`.

This is enough to:

- Prevent misinterpreting declarations of pointers to such types as expressions (`STACK_OF(int) * foo` -> `STACK_OF(int) *foo`),
- Avoid surprising line breaks in variable/struct field declarations (`STACK_OF(int)\nfoo;` -> `STACK_OF(int) foo;`, see https://bugs.llvm.org/show_bug.cgi?id=30353).


Repository:
  rC Clang

https://reviews.llvm.org/D57184

Files:
  docs/ClangFormatStyleOptions.rst
  include/clang/Format/Format.h
  lib/Format/Format.cpp
  lib/Format/FormatToken.h
  lib/Format/FormatTokenLexer.cpp
  lib/Format/TokenAnnotator.cpp
  unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57184.183383.patch
Type: text/x-patch
Size: 7653 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190124/c4d882b8/attachment-0001.bin>


More information about the cfe-commits mailing list