This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fix wrong indentation after trailing requires clause.
ClosedPublic

Authored by curdeius on Dec 22 2021, 11:55 AM.

Details

Summary

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

Before this patch, clang-format would wrongly parse top-level entities (e.g. namespaces) and format:

template<int I>
constexpr void foo requires(I == 42) {}
namespace ns {
void foo() {}
}  // namespace ns

into:

template<int I>
constexpr void foo requires(I == 42) {}
namespace ns {

void foo() {}

} // namespace ns

with configuration:

NamespaceIndentation: None

`

Diff Detail

Event Timeline

curdeius requested review of this revision.Dec 22 2021, 11:55 AM
curdeius created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2021, 11:55 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I really need to get my requires patch done...

This revision is now accepted and ready to land.Dec 22 2021, 1:53 PM
MyDeveloperDay accepted this revision.Dec 22 2021, 2:36 PM
owenpan accepted this revision.Dec 22 2021, 3:27 PM
This revision was landed with ongoing or failed builds.Dec 22 2021, 11:22 PM
This revision was automatically updated to reflect the committed changes.