[clang] clang-format: Add IndentGotoLabelsToCurrentScope option (PR #166730)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 6 12:21:58 PST 2025
================
@@ -3084,6 +3084,24 @@ struct FormatStyle {
/// \endcode
/// \version 10
bool IndentGotoLabels;
+
+ /// If true, aligns labels according to the current indentation level
+ /// instead of flushing them to the left margin.
+ ///
+ /// \code
+ /// true: false:
+ /// int main() { int main() {
+ /// for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
+ /// for (int j = 0; j < 5; j++) { for (int j = 0; j < 5; j++) {
+ /// // some code // some code
+ /// goto end_double_loop; goto end_double_loop;
+ /// } }
+ /// } }
+ /// end_double_loop: {} end_double_loop: {}
+ /// } }
+ /// \endcode
+ /// \version 19
+ bool IndentGotoLabelsToCurrentScope;
----------------
HazardyKnusperkeks wrote:
Change the `IndentGotoLabels` to an enum instead of adding a new option.
https://github.com/llvm/llvm-project/pull/166730
More information about the cfe-commits
mailing list