[PATCH] D43500: [clang-tidy]: modernize-use-default-member-init: Remove trailing comma and colon.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 11:07:06 PST 2018


aaron.ballman added a comment.

> It seems, when they are apply directly from clang-tidy, the RefactoringTool engine is smart enough to remove trailing tokens. However, when fixes are exported, clang-apply-replacements cannot do the same trick and will lead trailing commas and colon

Is there a way to make clang-apply-replacements smarter rather than forcing every check to jump through hoops? I'm worried that if we have to fix individual checks we'll just run into the same bug later.



================
Comment at: clang-tidy/modernize/UseDefaultMemberInitCheck.cpp:26
+                                           tok::TokenKind K) {
+  for (;;) {
+    Token Tok = utils::lexer::getPreviousToken(*Context, Location);
----------------
Eugene.Zelenko wrote:
> Please use while (true) instead.
Better still, don't use an infinite loop.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43500





More information about the cfe-commits mailing list