- clang adds support for a set of extended integer types (``_ExtInt(N)``) that
permit non-power of 2 integers, exposing the LLVM integer types. Since a major
motivating use case for these types is to limit 'bit' usage, these types don't
- automatically promote to 'int' when operations are done between two ``ExtInt(N)``
- types, instead math occurs at the size of the largest ``ExtInt(N)`` type.
+ automatically promote to 'int' when operations are done between two
+ ``ExtInt(N)`` types, instead math occurs at the size of the largest
+ ``ExtInt(N)`` type.
- Users of UBSan, PGO, and coverage on Windows will now need to add clang's
library resource directory to their library search path. These features all
linker. If the user links the program with the ``clang`` or ``clang-cl``
drivers, the driver will pass this flag for them.
-
New Compiler Flags
------------------
-
- -fstack-clash-protection will provide a protection against the stack clash
attack for x86 architecture through automatic probing of each page of
allocated stack.
- -ffp-exception-behavior={ignore,maytrap,strict} allows the user to specify
- the floating-point exception behavior. The default setting is ``ignore``.
+ the floating-point exception behavior. The default setting is ``ignore``.
- -ffp-model={precise,strict,fast} provides the user an umbrella option to
simplify access to the many single purpose floating point options. The default
- -fno-common has been enabled as the default for all targets. Therefore, C
code that uses tentative definitions as definitions of a variable in multiple
- translation units will trigger multiple-definition linker errors. Generally,
- this occurs when the use of the ``extern`` keyword is neglected in the declaration
- of a variable in a header file. In some cases, no specific translation unit
- provides a definition of the variable. The previous behavior can be restored by
- specifying ``-fcommon``.
+ translation units will trigger multiple-definition linker errors. Generally,
+ this occurs when the use of the ``extern`` keyword is neglected in the
+ declaration of a variable in a header file. In some cases, no specific
+ translation unit provides a definition of the variable. The previous
+ behavior can be restored by specifying ``-fcommon``.
- -Wasm-ignored-qualifier (ex. `asm const ("")`) has been removed and replaced
with an error (this matches a recent change in GCC-9).
- -Wasm-file-asm-volatile (ex. `asm volatile ("")` at global scope) has been
Previous versions of Clang rejected some constructs of this form
(specifically, where the linkage of the type happened to be computed
before the parser reached the typedef name); those cases are still rejected
- in Clang 11. In addition, cases that previous versions of Clang did not
+ in Clang 11. In addition, cases that previous versions of Clang did not
reject now produce an extension warning. This warning can be disabled with
the warning flag ``-Wno-non-c-typedef-for-linkage``.
Objective-C Language Changes in Clang
-------------------------------------
-
OpenCL C Language Changes in Clang
----------------------------------
ABI Changes in Clang
--------------------
-
OpenMP Support in Clang
-----------------------
Clang. If upgrading an external codebase that uses Clang as a library,
this section should help get you past the largest hurdles of upgrading.
-
Build System Changes
--------------------
clang-format
------------
-
- 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``).
-- Option ``ObjCBreakBeforeNestedBlockParam`` has been added to optionally apply
- linebreaks for function arguments declarations before nested blocks.
-
.. code-block:: c++
switch (fool) { vs. switch (fool) {
}
}
+- 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
Undefined Behavior Sanitizer (UBSan)
------------------------------------
-
Core Analysis Improvements
==========================