[PATCH] D146704: [clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date
MyDeveloperDay via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 23 03:00:35 PDT 2023
MyDeveloperDay updated this revision to Diff 507666.
MyDeveloperDay added a comment.
Ok it seems a fix has already been landed but its not correct (missing version)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146704/new/
https://reviews.llvm.org/D146704
Files:
clang/docs/ClangFormatStyleOptions.rst
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3642,6 +3642,95 @@
**MacroBlockEnd** (``String``) :versionbadge:`clang-format 3.7` :ref:`¶ <MacroBlockEnd>`
A regular expression matching macros that end a block.
+.. _Macros:
+<<<<<<<
+=======
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ <Macros>`
+ A list of macros of the form ``<definition>=<expansion>`` .
+
+ Code will be parsed with macros expanded, in order to determine how to
+ interpret and format the macro arguments.
+
+ For example, the code:
+
+ .. code-block:: c++
+
+ A(a*b);
+
+ will usually be interpreted as a call to a function A, and the
+ multiplication expression will be formatted as `a * b`.
+
+ If we specify the macro definition:
+
+ .. code-block:: yaml
+
+ Macros:
+ - A(x)=x
+
+ the code will now be parsed as a declaration of the variable b of type a*,
+ and formatted as `a* b` (depending on pointer-binding rules).
+
+ Features and restrictions:
+ * Both function-like macros and object-like macros are supported.
+ * Macro arguments must be used exactly once in the expansion.
+ * No recursive expansion; macros referencing other macros will be
+ ignored.
+ * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+ .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
+.. _MaxEmptyLinesToKeep:
+>>>>>>>
+
+**Macros** (``List of Strings``) :versionbadge:`clang-format 17.0` :ref:`¶ <Macros>`
+ A list of macros of the form ``<definition>=<expansion>`` .
+
+ Code will be parsed with macros expanded, in order to determine how to
+ interpret and format the macro arguments.
+
+ For example, the code:
+
+ .. code-block:: c++
+
+ A(a*b);
+
+ will usually be interpreted as a call to a function A, and the
+ multiplication expression will be formatted as `a * b`.
+
+ If we specify the macro definition:
+
+ .. code-block:: yaml
+
+ Macros:
+ - A(x)=x
+
+ the code will now be parsed as a declaration of the variable b of type a*,
+ and formatted as `a* b` (depending on pointer-binding rules).
+
+ Features and restrictions:
+ * Both function-like macros and object-like macros are supported.
+ * Macro arguments must be used exactly once in the expansion.
+ * No recursive expansion; macros referencing other macros will be
+ ignored.
+ * Overloading by arity is supported: for example, given the macro
+ definitions A=x, A()=y, A(a)=a:
+
+
+ .. code-block:: c++
+
+ A; -> x;
+ A(); -> y;
+ A(z); -> z;
+ A(a, b); // will not be expanded.
+
.. _MaxEmptyLinesToKeep:
**MaxEmptyLinesToKeep** (``Unsigned``) :versionbadge:`clang-format 3.7` :ref:`¶ <MaxEmptyLinesToKeep>`
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146704.507666.patch
Type: text/x-patch
Size: 2955 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230323/3692bcd0/attachment-0001.bin>
More information about the cfe-commits
mailing list