These are major changes to the build system that have happened since the 10.0.0
These are major changes to the build system that have happened since the 11.0.0
release of Clang. Users of the build system should adjust accordingly.
- clang-tidy and clang-include-fixer are no longer compiled into libclang by
default. You can set ``LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA=ON`` to undo that,
but it's expected that that setting will go away eventually. If this is
something you need, please reach out to the mailing list to discuss possible
ways forward.
- ...
AST Matchers
------------
@@ -298,103 +149,7 @@ AST Matchers
clang-format
------------
- Option ``IndentExternBlock`` has been added to optionally apply indenting inside ``extern "C"`` and ``extern "C++"`` blocks.
- ``IndentExternBlock`` option accepts ``AfterExternBlock`` to use the old behavior, as well as Indent and NoIndent options, which map to true and false, respectively.
.. code-block:: c++
Indent: NoIndent:
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C++" {
#endif #endif
void f(void); void f(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
- Option ``IndentCaseBlocks`` has been added to support treating the block
following a switch case label as a scope block which gets indented itself.
It helps avoid having the closing bracket align with the switch statement's
closing bracket (when ``IndentCaseLabels`` is ``false``).
.. code-block:: c++
switch (fool) { vs. switch (fool) {
case 1: case 1: {
{ bar();
bar(); } break;
} default: {
break; plop();
default: }
{ }
plop();
}
}
- Option ``ObjCBreakBeforeNestedBlockParam`` has been added to optionally apply
linebreaks for function arguments declarations before nested blocks.
- Option ``InsertTrailingCommas`` can be set to ``TCS_Wrapped`` to insert
trailing commas in container literals (arrays and objects) that wrap across
multiple lines. It is currently only available for JavaScript and disabled by
default (``TCS_None``).
- Option ``BraceWrapping.BeforeLambdaBody`` has been added to manage lambda
line break inside function parameter call in Allman style.
.. code-block:: c++
true:
connect(
[]()
{
foo();
bar();
});
false:
connect([]() {
foo();
bar();
});
- Option ``AlignConsecutiveBitFields`` has been added to align bit field
declarations across multiple adjacent lines
.. code-block:: c++
true:
bool aaa : 1;
bool a : 1;
bool bb : 1;
false:
bool aaa : 1;
bool a : 1;
bool bb : 1;
- Option ``BraceWrapping.BeforeWhile`` has been added to allow wrapping
before the ```while`` in a do..while loop. By default the value is (``false``)
In previous releases ``IndentBraces`` implied ``BraceWrapping.BeforeWhile``.
If using a Custom BraceWrapping style you may need to now set
``BraceWrapping.BeforeWhile`` to (``true``) to be explicit.