[PATCH] D12675: Avoid using rvalue references with trivially copyable types.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 08:24:56 PDT 2015


klimek added inline comments.

================
Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:658-663
@@ -646,7 +657,8 @@
+      IsTriviallyCopyable = BeginPointeeType.isTriviallyCopyableType(*Context);
     } else {
       // Check for qualified types to avoid conversions from non-const to const
       // iterator types.
       if (!Context->hasSameType(CanonicalInitVarType, CanonicalBeginType))
         return;
     }
 
----------------
angelgarcia wrote:
> klimek wrote:
> > Can you add a comment what FixerKind is in the else, so it's obvious why we don't want to do anything else in here?
> What do you mean? We're still inside the "if (FixerKind == LFK_Iterator)".
Ah, sorry, misread. So, why don't we want to check for trivial copy-ability for all types?

================
Comment at: clang-tidy/modernize/LoopConvertCheck.h:28
@@ -27,1 +27,3 @@
 private:
+  struct RangeDescriptor {
+    bool ContainerNeedsDereference;
----------------
Add a comment.


http://reviews.llvm.org/D12675





More information about the cfe-commits mailing list