[PATCH] D69764: [clang-format] Add Left/Right Const fixer capability

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 29 12:55:06 PDT 2021


HazardyKnusperkeks added inline comments.


================
Comment at: clang/docs/ClangFormatStyleOptions.rst:3233
+
+   ``QualifierAlignment`` COULD lead to incorrect code generation.
+
----------------
simon.giesecke wrote:
> This is pretty unclear, for a number of reasons:
> * First, this probably only refers to a setting other than `QAS_Leave`?
> * Second, "lead to incorrect code generation" seems to skip a step. In the first place, this seems to imply that a setting other than `QAS_Leave` might change the semantics of the source code.
> * Third, it's not clear to me when this would happen, and how likely that is. Does this mean "Non-default settings are experimental, and you shouldn't use this in production?" or rather "Under rare circumstances that are unlikely to happen in real code, a non-default setting might change semantics." At the minimum, could this give some example(s) when this happens?
* Yes.
* Yes, it might change the semantics, that was the content of a huge discussion here in the review and on the mailing list. Consensus was found that non whitespace changes are acceptable with a big warning and off by default.
* The latter, if we would have an example at hand in which cases it wouldn't work, we would fix that and not give it as an example. So to the best of our knowledge it does not break anything.

The warning text however might be improved.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69764/new/

https://reviews.llvm.org/D69764



More information about the cfe-commits mailing list