[PATCH] D25769: [clang-tidy] Simplify modernize-use-default

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 06:54:02 PDT 2016


ioeric accepted this revision.
ioeric added inline comments.


================
Comment at: test/clang-tidy/modernize-use-default-copy.cpp:85
+  // CHECK-MESSAGES: :[[@LINE-2]]:3: warning: use '= default'
+  // CHECK-FIXES: /* don't delete */  = default;
   int Field;
----------------
malcolm.parsons wrote:
> I don't know why cleanup removes this comment, but there are format units tests that check that it does.
This is intended behavior of `cleanup`. Generally, if a deleted code results in a redundant token around it, comments between the redundant token and its previous/next token (ignoring the deleted code) are considered belonging to the deleted code. Considering how a normal developer writes code, this would be correct most of the time IMO. 


https://reviews.llvm.org/D25769





More information about the cfe-commits mailing list