This concerns bug #17362 (https://bugs.llvm.org//show_bug.cgi?id=17362).
2 styles for indenting are added: before and after hash.
3 methods:
- None (default): equivalent to current behaviour of clang-format
- All: indents all directives
- Inner: recognizes include guards and ignores them during indentation
Indentation level uses IndentWidth style parameter.
For instance, and indented code with include guards:
#ifndef INCLUDE_GUARD #define INCLUDE_GUARD #define A // not indented with Inner method #ifdef B # undef B #else # define C #endif #endif // INCLUDE_GUARD
I've tried to make the detection of include guards as correct as possible, but if you know of any edge cases that are not taken into account, I'm all ears.