This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] : Fix additional pointer alignment for overloaded operators
ClosedPublic

Authored by MyDeveloperDay on Apr 30 2020, 1:32 PM.

Details

Summary

Follow on from D78879: [clang-format] [PR45357] Fix issue found with operator spacing to handle the more obscure to prevent spaces between operators

operator void *&();
operator void *&&();
operator void &*();
operator void &&*();

Diff Detail

Event Timeline

MyDeveloperDay created this revision.Apr 30 2020, 1:32 PM

Looks OK but covers a lot of cases that can't happen, we should probably not test those at least :-)

clang/lib/Format/TokenAnnotator.cpp
2817

Maybe left should only be star and right should be any?

T &* isn't a thing as far as I know, there are no pointers to references.
T && &, T & && etc don't occur as far as I know (and removing the space would seem dubious!)

Abpostelnicu requested changes to this revision.May 3 2020, 11:10 PM

As per what @sammccall said.

This revision now requires changes to proceed.May 3 2020, 11:10 PM
MyDeveloperDay planned changes to this revision.May 4 2020, 12:45 AM

Remove extraneous cases

sammccall accepted this revision.May 11 2020, 4:30 AM

Sorry, I thought I approved already :-(

@Abpostelnicu as you requested changes I need an "Accept" from you

Abpostelnicu accepted this revision.May 12 2020, 12:31 AM

Sorry, totally forgot about this, thank you!

This revision is now accepted and ready to land.May 12 2020, 12:31 AM
This revision was automatically updated to reflect the committed changes.