[all-commits] [llvm/llvm-project] 42ee33: [clang-format] Handle shifts within conditions

MyDeveloperDay via All-commits all-commits at lists.llvm.org
Tue Sep 8 10:03:54 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 42ee33ca2bee10faedb6a02031c88bd6f70193f0
      https://github.com/llvm/llvm-project/commit/42ee33ca2bee10faedb6a02031c88bd6f70193f0
  Author: mydeveloperday <mydeveloperday at gmail.com>
  Date:   2020-09-08 (Tue, 08 Sep 2020)

  Changed paths:
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [clang-format] Handle shifts within conditions

In some situation shifts can be treated as a template, and is thus formatted as one. So, by doing a couple extra checks to assure that the condition doesn't contain a template, and is in fact a bit shift should solve this problem.

This is a fix for [[ https://bugs.llvm.org/show_bug.cgi?id=46969 | bug 46969 ]]

Reviewed By: MyDeveloperDay

Patch By: Saldivarcher

Differential Revision: https://reviews.llvm.org/D86581

(cherry picked from commit c81dd3d159ab03d46e4280c458d3c29e56648218)




More information about the All-commits mailing list