This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] [PR27004] omits leading space for noexcept when formatting operator delete()
ClosedPublic

Authored by MyDeveloperDay on Oct 4 2019, 1:12 PM.

Details

Summary

clang-format is incorrectly thinking the parameter parens are part of a cast operation, this is resulting in there sometimes being not space between the paren and the noexcept (and other keywords like volatile etc..)

void operator++(int) noexcept;
void operator++(int &) noexcept;
void operator delete(void *, std::size_t, const std::nothrow_t &)noexcept;

Diff Detail

Repository
rL LLVM

Event Timeline

MyDeveloperDay created this revision.Oct 4 2019, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2019, 1:12 PM
mitchell-stellar requested changes to this revision.Oct 4 2019, 2:23 PM
mitchell-stellar added inline comments.
clang/lib/Format/TokenAnnotator.cpp
1617 ↗(On Diff #223273)

What about the "override" decorator? Would that apply here too?

This revision now requires changes to proceed.Oct 4 2019, 2:23 PM
MyDeveloperDay marked 2 inline comments as done.

Add additional override and final keywords

MyDeveloperDay added inline comments.Oct 5 2019, 3:17 AM
clang/lib/Format/TokenAnnotator.cpp
1617 ↗(On Diff #223273)

good catch! Thank you

This revision is now accepted and ready to land.Oct 7 2019, 9:27 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2019, 10:15 PM