[clang] b4ad387 - [clang-format][doc] Fix C++ code blocks for IntegerLiteralSeparator
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 11 13:24:50 PST 2023
Author: Owen Pan
Date: 2023-01-11T13:24:39-08:00
New Revision: b4ad387ec558dc886c2ab85e4aea10c111cc83c0
URL: https://github.com/llvm/llvm-project/commit/b4ad387ec558dc886c2ab85e4aea10c111cc83c0
DIFF: https://github.com/llvm/llvm-project/commit/b4ad387ec558dc886c2ab85e4aea10c111cc83c0.diff
LOG: [clang-format][doc] Fix C++ code blocks for IntegerLiteralSeparator
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 3b3079584db7a..6d0df7b35894c 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -3222,28 +3222,28 @@ the configuration (without a prefix: ``Auto``).
* ``int8_t Binary`` Format separators in binary literals.
- .. code-block:: text
+ .. code-block:: c++
- -1: 0b100111101101
- 0: 0b10011'11'0110'1
- 3: 0b100'111'101'101
- 4: 0b1001'1110'1101
+ /* -1: */ b = 0b100111101101;
+ /* 0: */ b = 0b10011'11'0110'1;
+ /* 3: */ b = 0b100'111'101'101;
+ /* 4: */ b = 0b1001'1110'1101;
* ``int8_t Decimal`` Format separators in decimal literals.
- .. code-block:: text
+ .. code-block:: c++
- -1: 18446744073709550592ull
- 0: 184467'440737'0'95505'92ull
- 3: 18'446'744'073'709'550'592ull
+ /* -1: */ d = 18446744073709550592ull;
+ /* 0: */ d = 184467'440737'0'95505'92ull;
+ /* 3: */ d = 18'446'744'073'709'550'592ull;
* ``int8_t Hex`` Format separators in hexadecimal literals.
- .. code-block:: text
+ .. code-block:: c++
- -1: 0xDEADBEEFDEADBEEFuz
- 0: 0xDEAD'BEEF'DE'AD'BEE'Fuz
- 2: 0xDE'AD'BE'EF'DE'AD'BE'EFuz
+ /* -1: */ h = 0xDEADBEEFDEADBEEFuz;
+ /* 0: */ h = 0xDEAD'BEEF'DE'AD'BEE'Fuz;
+ /* 2: */ h = 0xDE'AD'BE'EF'DE'AD'BE'EFuz;
**JavaImportGroups** (``List of Strings``) :versionbadge:`clang-format 8`
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index eadf1ea4fa8f2..f2efe820f36cb 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -2501,25 +2501,25 @@ struct FormatStyle {
/// \endcode
struct IntegerLiteralSeparatorStyle {
/// Format separators in binary literals.
- /// \code{.text}
- /// -1: 0b100111101101
- /// 0: 0b10011'11'0110'1
- /// 3: 0b100'111'101'101
- /// 4: 0b1001'1110'1101
+ /// \code
+ /// /* -1: */ b = 0b100111101101;
+ /// /* 0: */ b = 0b10011'11'0110'1;
+ /// /* 3: */ b = 0b100'111'101'101;
+ /// /* 4: */ b = 0b1001'1110'1101;
/// \endcode
int8_t Binary;
/// Format separators in decimal literals.
- /// \code{.text}
- /// -1: 18446744073709550592ull
- /// 0: 184467'440737'0'95505'92ull
- /// 3: 18'446'744'073'709'550'592ull
+ /// \code
+ /// /* -1: */ d = 18446744073709550592ull;
+ /// /* 0: */ d = 184467'440737'0'95505'92ull;
+ /// /* 3: */ d = 18'446'744'073'709'550'592ull;
/// \endcode
int8_t Decimal;
/// Format separators in hexadecimal literals.
- /// \code{.text}
- /// -1: 0xDEADBEEFDEADBEEFuz
- /// 0: 0xDEAD'BEEF'DE'AD'BEE'Fuz
- /// 2: 0xDE'AD'BE'EF'DE'AD'BE'EFuz
+ /// \code
+ /// /* -1: */ h = 0xDEADBEEFDEADBEEFuz;
+ /// /* 0: */ h = 0xDEAD'BEEF'DE'AD'BEE'Fuz;
+ /// /* 2: */ h = 0xDE'AD'BE'EF'DE'AD'BE'EFuz;
/// \endcode
int8_t Hex;
};
More information about the cfe-commits
mailing list