From dd3caa99bd874671a4c5c9657bd5e335dbfd3e0a Mon Sep 17 00:00:00 2001 From: mydeveloperday Date: Sat, 2 Oct 2021 13:18:00 +0100 Subject: [PATCH] [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 --- clang/docs/ClangFormatStyleOptions.rst | 6 +++++- clang/include/clang/Format/Format.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index 7e4d158..c05fbc7 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -3238,7 +3238,11 @@ the configuration (without a prefix: ``Auto``). .. warning:: - ``QualifierAlignment`` COULD lead to incorrect code generation. + Setting ``QualifierAlignment`` to something other than `Leave`, COULD + lead to incorrect code formatting due to incorrect decisions made due to + clang-formats lack of complete semantic information. + As such extra care should be taken to review code changes made by the use + of this option. Possible values: diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h index a6fd446..df553c3 100644 --- a/clang/include/clang/Format/Format.h +++ b/clang/include/clang/Format/Format.h @@ -1898,7 +1898,11 @@ struct FormatStyle { /// Different ways to arrange specifiers and qualifiers (e.g. const/volatile). /// \warning - /// ``QualifierAlignment`` COULD lead to incorrect code generation. + /// Setting ``QualifierAlignment`` to something other than `Leave`, COULD + /// lead to incorrect code formatting due to incorrect decisions made due to + /// clang-formats lack of complete semantic information. + /// As such extra care should be taken to review code changes made by the use + /// of this option. /// \endwarning /// \version 14 QualifierAlignmentStyle QualifierAlignment; -- 2.7.4