This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] regression from clang-format v13
ClosedPublic

Authored by MyDeveloperDay on Feb 3 2022, 8:08 AM.

Details

Summary

https://github.com/llvm/llvm-project/issues/53567

The following source

namespace A {

template <int N> struct Foo<char[N]> {
  void foo() { std::cout << "Bar"; }
}; // namespace A

is incorrectly formatted as:

namespace A {

template <int N> struct Foo<char[N]>{void foo(){std::cout << "Bar";
}
}
; // namespace A

This looks to be caused by https://github.com/llvm/llvm-project/commit/5c2e7c9ca043d92bed75b08e653fb47c384edd13

Diff Detail

Event Timeline

MyDeveloperDay requested review of this revision.Feb 3 2022, 8:08 AM
MyDeveloperDay created this revision.
curdeius accepted this revision.Feb 3 2022, 8:37 AM
curdeius added inline comments.
clang/lib/Format/UnwrappedLineParser.cpp
3061

Maybe it would be easier to read if written !(is(tok::r_paren) || isTypeOrIdentifier())?

This revision is now accepted and ready to land.Feb 3 2022, 8:37 AM

Simply logic - review comment

MyDeveloperDay marked an inline comment as done.Feb 3 2022, 10:34 AM

De'Morganed!!

This revision was landed with ongoing or failed builds.Feb 3 2022, 10:38 AM
This revision was automatically updated to reflect the committed changes.