This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] QualifierOrder does not reorder template arguments
ClosedPublic

Authored by MyDeveloperDay on Mar 1 2022, 3:18 AM.

Details

Summary

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

Reorder the qualifiers inside the template argument. This should handle the simple cases of

<const T>
<T const>

But only by relaxing that single letter capital variables are not possible macros

Fixes: #53981

Diff Detail

Event Timeline

MyDeveloperDay requested review of this revision.Mar 1 2022, 3:18 AM
MyDeveloperDay created this revision.
curdeius accepted this revision.Mar 1 2022, 4:34 AM

LGTM. Thanks for fixing this!

clang/lib/Format/QualifierAlignmentFixer.cpp
344–346
This revision is now accepted and ready to land.Mar 1 2022, 4:34 AM
HazardyKnusperkeks added inline comments.
clang/lib/Format/QualifierAlignmentFixer.cpp
480–482

Maybe?

clang/unittests/Format/QualifierFixerTest.cpp
910

As far as I understand stuff like <const Container> worked before? But maybe still add it as test case.

curdeius added inline comments.Mar 2 2022, 8:54 AM
clang/unittests/Format/QualifierFixerTest.cpp
910

It didn't work before at all.
+1 for adding a test with a longer name.

Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 8:54 AM
MyDeveloperDay marked 4 inline comments as done.Mar 5 2022, 9:44 AM
This revision was landed with ongoing or failed builds.Mar 5 2022, 10:09 AM
This revision was automatically updated to reflect the committed changes.