Skip to content

One-line case being split up #16909

@jfbastien

Description

@jfbastien
Bugzilla Link 16535
Version trunk
OS All
CC @chandlerc,@silvasean

Extended Description

Your suggested formatting:

int foo(int i) {
  switch (i) {
  default: return 5;
  case 0: return 3;
  case 1: return 2;
  case 2: return 1;
  case 3: return 0;
  }
}

clang-format's current output:

int foo(int i) {
  switch (i) {
  default:
    return 5;
  case 0:
    return 3;
  case 1:
    return 2;
  case 2:
    return 1;
  case 3:
    return 0;
  }
}

Additional information:
It's nice to keep the code concise if it originally was.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang-formatenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions