Issue 80981
Summary Inconsistent indentation
Labels
Assignees
Reporter HFriberg
    When I format
```c
#ifdef __cplusplus
extern "C"
{
#endif

#if 0
typedef int myint;
  typedef double mydouble;
#endif

#if 1
#else
typedef int myint2;
  typedef double mydouble2;
#endif

typedef int myint3;
  typedef double mydouble3;

#ifdef __cplusplus
} /* extern "C" */
#endif
```

I get
```c
#ifdef __cplusplus
extern "C"
{
#endif

#if 0
typedef int myint;
  typedef double mydouble;
#endif

#if 1
#else
typedef int myint2;
typedef double mydouble2;
#endif

  typedef int myint3;
  typedef double mydouble3;

#ifdef __cplusplus
} /* extern "C" */
#endif
```

1) Why is formatting inactive in the `#if 0` block, but active in the `#if 1 ... #else` block?

2) Why is the indentation of `myint2` and `mydouble2` inconsistent with the indentation of `myint3` and `mydouble3`?

---

My `.clang-format` style is
```
BasedOnStyle: LLVM
BreakBeforeBraces: Allman
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to