[all-commits] [llvm/llvm-project] 17fb87: [clang-format] FIX: Misannotation 'auto' as traili...

Aleksandr Platonov via All-commits all-commits at lists.llvm.org
Wed Jul 27 12:22:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 17fb879764dcaf1f5f6bc505c5c747067ba7c3cd
      https://github.com/llvm/llvm-project/commit/17fb879764dcaf1f5f6bc505c5c747067ba7c3cd
  Author: Denis Fatkulin <fatkulin.denis at huawei.com>
  Date:   2022-07-27 (Wed, 27 Jul 2022)

  Changed paths:
    M clang/lib/Format/UnwrappedLineParser.cpp
    M clang/unittests/Format/TokenAnnotatorTest.cpp

  Log Message:
  -----------
  [clang-format] FIX: Misannotation 'auto' as trailing return type in lambdas

Lambdas with trailing return type 'auto' are annotated incorrectly. It causes a misformatting. The simpliest code to reproduce is:

```
auto list = {[]() -> auto { return 0; }};
```

Fixes https://github.com/llvm/llvm-project/issues/54798

Reviewed By: HazardyKnusperkeks, owenpan, curdeius

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




More information about the All-commits mailing list