[PATCH] D110801: [clang-format] [docs] [NFC] improve clarity in the QualifierAlignment warning

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 30 00:16:34 PDT 2021


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: HazardyKnusperkeks, simon.giesecke.
MyDeveloperDay added projects: clang, clang-format.
MyDeveloperDay requested review of this revision.

Improve the clarity and guidance of the warning when using code modifying option in clang-format see D69764: [clang-format] Add Left/Right Const fixer capability <https://reviews.llvm.org/D69764>

F19325014: image.png <https://reviews.llvm.org/F19325014>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110801

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===================================================================
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -1898,7 +1898,10 @@
 
   /// Different ways to arrange const/volatile qualifiers.
   /// \warning
-  ///  ``QualifierAlignment`` COULD lead to incorrect code generation.
+  ///  Setting ``QualifierAlignment``  to something other than `Leave`, COULD
+  ///  lead to incorrect code generation due to a lack of semantic information
+  ///  especially in the presense of macros, care should be take to review code
+  ///  changes made by this option.
   /// \endwarning
   /// \version 14
   QualifierAlignmentStyle QualifierAlignment;
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3238,7 +3238,10 @@
 
   .. warning:: 
 
-   ``QualifierAlignment`` COULD lead to incorrect code generation.
+   Setting ``QualifierAlignment``  to something other than `Leave`, COULD
+   lead to incorrect code generation due to a lack of semantic information
+   especially in the presense of macros, care should be take to review code
+   changes made by this option.
 
   Possible values:
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110801.376115.patch
Type: text/x-patch
Size: 1323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210930/d965f567/attachment.bin>


More information about the cfe-commits mailing list