[all-commits] [llvm/llvm-project] 31fd12: [clang-format] [PR34574] Handle [[nodiscard]] attr...

MyDeveloperDay via All-commits all-commits at lists.llvm.org
Sat May 9 03:27:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 31fd12aa09563d8402b1aefceaa2311b680e138c
      https://github.com/llvm/llvm-project/commit/31fd12aa09563d8402b1aefceaa2311b680e138c
  Author: mydeveloperday <mydeveloperday at gmail.com>
  Date:   2020-05-09 (Sat, 09 May 2020)

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

  Log Message:
  -----------
  [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

Summary:
https://bugs.llvm.org/show_bug.cgi?id=34574
https://bugs.llvm.org/show_bug.cgi?id=38401

```
template <typename T>
class [[nodiscard]] result
{
  public:
    result(T&&)
    {
    }
};
```

formats incorrectly to

```
template <typename T>
class [[nodiscard]] result{public : result(T &&){}};
```

Reviewed By: krasimir

Subscribers: cfe-commits

Tags: #clang, #clang-format

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




More information about the All-commits mailing list