[clang] 7c92820 - Revert "[clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date"
via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 23 02:53:32 PDT 2023
Author: mydeveloperday
Date: 2023-03-23T09:52:59Z
New Revision: 7c928205c1f5a972f1f4dbeae83bd979c9a617d7
URL: https://github.com/llvm/llvm-project/commit/7c928205c1f5a972f1f4dbeae83bd979c9a617d7
DIFF: https://github.com/llvm/llvm-project/commit/7c928205c1f5a972f1f4dbeae83bd979c9a617d7.diff
LOG: Revert "[clang-format] NFC Format.h and ClangFormatStyleOptions.rst are out of date"
This reverts commit 7a5b95732ade6c2de69b26f1038aa0a5afc39393.
Added:
Modified:
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
Removed:
################################################################################
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index 37500d7bff52d..fd8f2bbb54322 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -3642,95 +3642,6 @@ the configuration (without a prefix: ``Auto``).
**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>`
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index e2709cca3967f..66904a6a11232 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -2754,56 +2754,28 @@ struct FormatStyle {
/// \code
/// A(a*b);
/// \endcode
- ///
/// 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{.yaml}
+ /// \code
/// Macros:
/// - A(x)=x
/// \endcode
- ///
/// 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
- /// A; -> x;
- /// A(); -> y;
- /// A(z); -> z;
- /// A(a, b); // will not be expanded.
- /// \endcode
- ///
- /// \version 17.0
- std::vector<std::string> Macros;
-
- /// The maximum number of consecutive empty lines to keep.
->>>>>>>
- /// * 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
+ /// * 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
- /// A; -> x;
- /// A(); -> y;
- /// A(z); -> z;
- /// A(a, b); // will not be expanded.
- /// \endcode
- ///
- /// \version 17.0
+ /// * Overloading by arity is supported: for example, given the macro
+ /// definitions A=x, A()=y, A(a)=a,
+ /// 'A;' -> 'x;'
+ /// 'A();' -> 'y;'
+ /// 'A(z);' -> 'z;'
+ /// 'A(a, b) will not be expanded.
std::vector<std::string> Macros;
/// The maximum number of consecutive empty lines to keep.
More information about the cfe-commits
mailing list