In https://reviews.llvm.org/D127873, I missed the case bool b = 3 == int{3} && true;.
The function modifyContext will annotate && as a reference operator if there is a = behind &&. So, we can remove these redundant rules.
Paths
| Differential D131750
[clang-format] Distinguish logical and after bracket from reference ClosedPublic Authored by jackhong12 on Aug 11 2022, 11:39 PM.
Details Summary In https://reviews.llvm.org/D127873, I missed the case bool b = 3 == int{3} && true;. The function modifyContext will annotate && as a reference operator if there is a = behind &&. So, we can remove these redundant rules.
Diff Detail
Event TimelineThis comment was removed by jackhong12. This revision is now accepted and ready to land.Aug 12 2022, 7:01 PM Closed by commit rGef71383b0cfb: [clang-format] Distinguish logical and after bracket from reference (authored by jackh <jackhuang1205@gmail.com>). · Explain WhyAug 12 2022, 8:54 PM This revision was automatically updated to reflect the committed changes. Comment Actions Is there any chance we also add this patch to version 15? https://github.com/llvm/llvm-project/issues/57534#issuecomment-1236132578
Revision Contents
Diff 452370 clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/TokenAnnotatorTest.cpp
|
Removing it would suffice.