@@ -79,7 +79,15 @@ code bases.
7979 Undefined behavior due to pointer addition overflow can be reliably detected
8080 using ``-fsanitize=pointer-overflow ``. It is also possible to use
8181 ``-fno-strict-overflow `` to opt-in to a language dialect where signed integer
82- and pointer overflow are well-defined.
82+ and pointer overflow are well-defined. Since Clang 20, it is also possible
83+ to use ``-fwrapv-pointer `` to only make pointer overflow well-defined, while
84+ not affecting the behavior of signed integer overflow.
85+
86+ - The ``-fwrapv `` flag now only makes signed integer overflow well-defined,
87+ without affecting pointer overflow, which is controlled by a new
88+ ``-fwrapv-pointer `` flag. The ``-fno-strict-overflow `` flag now implies
89+ both ``-fwrapv `` and ``-fwrapv-pointer `` and as such retains its old meaning.
90+ The new behavior matches GCC.
8391
8492C/C++ Language Potentially Breaking Changes
8593-------------------------------------------
@@ -519,6 +527,20 @@ New Compiler Flags
519527 only for thread-local variables, and none (which corresponds to the
520528 existing ``-fno-c++-static-destructors `` flag) skips all static
521529 destructors registration.
530+ - The ``-fextend-variable-liveness `` flag has been added to allow for improved
531+ debugging of optimized code. Using ``-fextend-variable-liveness `` will cause
532+ Clang to generate code that tries to preserve the liveness of source variables
533+ through optimizations, meaning that variables will typically be visible in a
534+ debugger more often. The flag has two levels: ``-fextend-variable-liveness ``,
535+ or ``-fextend-variable-liveness=all ``, extendes the liveness of all user
536+ variables and the ``this `` pointer. Alternatively ``-fextend-this-ptr ``, or
537+ ``-fextend-variable-liveness=this ``, has the same behaviour but applies only
538+ to the ``this `` variable in C++ class member functions, meaning its effect is
539+ a strict subset of ``-fextend-variable-liveness ``. Note that this flag
540+ modifies the results of optimizations that Clang performs, which will result
541+ in reduced performance in generated code; however, this feature will not
542+ extend the liveness of some variables in cases where doing so would likely
543+ have a severe impact on generated code performance.
522544
523545- The ``-Warray-compare `` warning has been added to warn about array comparison
524546 on versions older than C++20.
@@ -529,6 +551,11 @@ New Compiler Flags
529551- clang-cl and clang-dxc now support ``-fdiagnostics-color=[auto|never|always] ``
530552 in addition to ``-f[no-]color-diagnostics ``.
531553
554+ - The new ``-fwrapv-pointer `` flag opts-in to a language dialect where pointer
555+ overflow is well-defined. The ``-fwrapv `` flag previously implied
556+ ``-fwrapv-pointer `` as well, but no longer does. ``-fno-strict-overflow ``
557+ implies ``-fwrapv -fwrapv-pointer ``. The flags now match GCC.
558+
532559Deprecated Compiler Flags
533560-------------------------
534561
@@ -1328,6 +1355,7 @@ clang-format
13281355- Adds support for bash globstar in ``.clang-format-ignore ``.
13291356- Adds ``WrapNamespaceBodyWithEmptyLines `` option.
13301357- Adds the ``IndentExportBlock `` option.
1358+ - Adds ``PenaltyBreakBeforeMemberAccess `` option.
13311359
13321360libclang
13331361--------
0 commit comments