<div dir="ltr"><div>Hi,</div><div><br></div><div>I've worked on 'misc-qualifiers-order' check for clang-tidy some time ago, but haven't finished it, but it's still working in the most casual cases. There are some corner cases that I haven't solved, e.g. combined const/restrict/volatile qualifiers, (nested) pointers and template parameters and arguments, probably typedef and using type aliases aren't covered either.</div><div>You'll see it in the tests anyway.</div><div><br></div><div>You can have a look at:</div><div><a href="https://github.com/mkurdej/clang-tools-extra/tree/feature/clang-tidy-misc-qualifiers-order">https://github.com/mkurdej/clang-tools-extra/tree/feature/clang-tidy-misc-qualifiers-order</a><br></div><div><br></div><div>Patches/PRs welcome!</div><div><br></div>Best regards,<br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div style="font-family:arial;font-size:small"><div>Marek Kurdej</div><div><br></div><div><div dir="ltr" style="font-family:arial,sans-serif;font-size:12.8px"><br style="font-size:small"><span style="font-size:small">---------- Wiadomość przekazana dalej ----------</span><br style="font-size:small"><span style="font-size:small">From: David Blaikie via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>></span><br style="font-size:small"><span style="font-size:small">To: Sven Over <<a href="mailto:sven@svenover.de">sven@svenover.de</a>></span><br style="font-size:small"><span style="font-size:small">Cc: Clang Developers <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>></span><br style="font-size:small"><span style="font-size:small">Date: Fri, 18 Mar 2016 08:13:04 -0700</span><br style="font-size:small"><span style="font-size:small">Subject: Re: [cfe-dev] clang-format: placement of cv-qualifiers</span><br style="font-size:small"><div dir="ltr" style="font-size:small">This is probably more of a job for clang-tidy rather than clang-format. The places where clang-format does anything more than modify whitespace (as is the case here - reordering tokens) are pretty carefully selected. Whereas clang-tidy is intended for all sorts of non-whitespace changes, including the sort of thing you've described here.<br><br>I don't think I've heard of anyone working on something like this.</div><div class="gmail_extra" style="font-size:small"><br><div class="gmail_quote">On Fri, Mar 18, 2016 at 5:04 AM, Sven Over via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi, Clang Developers!<br><br>It would be extremely useful for me if clang-format could take care of the placement of the cv-qualifier in cv-qualified types. What I mean is that I would like to use clang-format to enforce a convention to put cv-qualifiers on the left side of a type, i.e. write<br><br>  T const, T const*, T const* const<br><br>instead of<br><br>  const T, const T*, const T* const<br><br>I'm thinking of an option like<br><br>  CVQualifier: left<br><br>to enforce "T const" etc.,<br><br>  CVQualifier: right<br><br>to enforce "const T" etc., and<br><br>  CVQualifier: none<br><br>to not enforce either and leave cv-qualifiers where they are.<br><br>I was wondering if any work in that direction has been done already. I can't find anything. Also, if anyone has some helpful ideas/pointers, I'd be very grateful. I've only spend a few hours dabbling with clang refactoring, so it'll take me some amount of time to understand how this could be implemented. Time well invested, I guess, but still, if someone has some ideas, please do tell!<br><br>Thanks everyone!<br>Sven.<br><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></blockquote></div><br></div></div></div></div></div></div></div></div>
</div>