Skip to content

Commit 8b5f6c1

Browse files
[clang-format] [NFC] add recent changes to release notes
Summary: clang-tidy keeps nice release notes of what is added, have clang-format do the same. Reviewers: klimek, mitchell-stellar, sylvestre.ledru, sammccall Reviewed By: mitchell-stellar Subscribers: merge_guards_bot, Eugene.Zelenko, cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D70355
1 parent 4a64d71 commit 8b5f6c1

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Improvements to Clang's diagnostics
5858
access to determine if two operand expressions are the same.
5959
- -Wtautological-bitwise-compare is a new warning group. This group has the
6060
current warning which diagnoses the tautological comparison of a bitwise
61-
operation and a constant. The group also has the new warning which diagnoses
61+
operation and a constant. The group also has the new warning which diagnoses
6262
when a bitwise-or with a non-negative value is converted to a bool, since
6363
that bool will always be true.
6464
- -Wbitwise-conditional-parentheses will warn on operator precedence issues
@@ -138,9 +138,6 @@ Windows Support
138138
139139
error LNK2005: "bool const std::_Is_integral<int>" (??$_Is_integral@H@std@@3_NB) already defined
140140
141-
142-
143-
144141
C Language Changes in Clang
145142
---------------------------
146143

@@ -296,13 +293,16 @@ clang-format
296293
- ``Auto`` is the default and detects style from the code (this is unchanged).
297294

298295
The previous values of ``Cpp03`` and ``Cpp11`` are deprecated. Note that
299-
``Cpp11`` is treated as ``Latest``, as this was always clang-format's behavior.
300-
(One motivation for this change is the new name describes the behavior better).
296+
``Cpp11`` is treated as ``Latest``, as this was always clang-format's
297+
behavior. (One motivation for this change is the new name describes the
298+
behavior better).
301299

302-
- clang-format gets a new option called ``--dry-run`` or ``-n`` to emit a
303-
warning.
300+
- Clang-format has a new option called ``--dry-run`` or ``-n`` to emit a
301+
warning for clang-format violations. This can be used together
302+
with --ferror-limit=N to limit the number of warnings per file and --Werror
303+
to make warnings into errors.
304304

305-
- Option *IncludeIsMainSourceRegex* added to allow for additional
305+
- Option *IncludeIsMainSourceRegex* has been added to allow for additional
306306
suffixes and file extensions to be considered as a source file
307307
for execution of logic that looks for "main *include* file" to put
308308
it on top.
@@ -311,7 +311,7 @@ clang-format
311311
they end with: ``.c``, ``.cc``, ``.cpp``, ``.c++``, ``.cxx``,
312312
``.m`` or ``.mm`` extensions. This config option allows to
313313
extend this set of source files considered as "main".
314-
314+
315315
For example, if this option is configured to ``(Impl\.hpp)$``,
316316
then a file ``ClassImpl.hpp`` is considered "main" (in addition to
317317
``Class.c``, ``Class.cc``, ``Class.cpp`` and so on) and "main
@@ -320,12 +320,31 @@ clang-format
320320
``ClassImpl.hpp`` would not have the main include file put on top
321321
before any other include.
322322

323+
- Options ``DeriveLineEnding`` and ``UseCRLF`` have been added to allow
324+
clang-format to control the newlines. ``DeriveLineEnding`` is by default
325+
``true`` and reflects is the existing mechanism, which based is on majority
326+
rule. The new options allows this to be turned off and ``UseCRLF`` to control
327+
the decision as to which sort of line ending to use.
328+
329+
- Option ``SpaceBeforeSquareBrackets`` has been added to insert a space before
330+
array declarations.
331+
332+
.. code-block:: c++
333+
334+
int a [5]; vs int a[5];
335+
336+
- Clang-format now supports JavaScript null operators.
337+
338+
.. code-block:: c++
339+
340+
const x = foo ?? default;
341+
const z = foo?.bar?.baz;
342+
323343
libclang
324344
--------
325345

326346
- ...
327347

328-
329348
Static Analyzer
330349
---------------
331350

@@ -373,7 +392,6 @@ Undefined Behavior Sanitizer (UBSan)
373392
return getelementpointer_inbounds(base, offset);
374393
}
375394
376-
377395
Core Analysis Improvements
378396
==========================
379397

0 commit comments

Comments
 (0)