Skip to content

Commit e6caa87

Browse files
mydeveloperdaymemfrob
authored andcommitted
[clang-format] [docs] [NFC] improve clarity in the QualifierAlignment warning
Improve the clarity and guidance of the warning when using code modifying option in clang-format see {D69764} Reviewed By: HazardyKnusperkeks, curdeius Differential Revision: https://reviews.llvm.org/D110801
1 parent 2b5286e commit e6caa87

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3238,7 +3238,11 @@ the configuration (without a prefix: ``Auto``).
32383238

32393239
.. warning::
32403240

3241-
``QualifierAlignment`` COULD lead to incorrect code generation.
3241+
Setting ``QualifierAlignment`` to something other than `Leave`, COULD
3242+
lead to incorrect code formatting due to incorrect decisions made due to
3243+
clang-formats lack of complete semantic information.
3244+
As such extra care should be taken to review code changes made by the use
3245+
of this option.
32423246

32433247
Possible values:
32443248

clang/include/clang/Format/Format.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,11 @@ struct FormatStyle {
18981898

18991899
/// Different ways to arrange specifiers and qualifiers (e.g. const/volatile).
19001900
/// \warning
1901-
/// ``QualifierAlignment`` COULD lead to incorrect code generation.
1901+
/// Setting ``QualifierAlignment`` to something other than `Leave`, COULD
1902+
/// lead to incorrect code formatting due to incorrect decisions made due to
1903+
/// clang-formats lack of complete semantic information.
1904+
/// As such extra care should be taken to review code changes made by the use
1905+
/// of this option.
19021906
/// \endwarning
19031907
/// \version 14
19041908
QualifierAlignmentStyle QualifierAlignment;

0 commit comments

Comments
 (0)