HomePhabricator

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

Authored by MyDeveloperDay on May 9 2020, 3:26 AM.

Description

[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