<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 9, 2018 at 3:15 AM Pavel Labath via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath added inline comments.<br>
<br>
<br>
================<br>
Comment at: include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h:290-295<br>
+    Entry(const Entry &RHS) : NameIdx(RHS.NameIdx), Abbr(RHS.Abbr) {<br>
+      Values = RHS.Values;<br>
+    }<br>
+    Entry(Entry &&RHS) : NameIdx(RHS.NameIdx), Abbr(RHS.Abbr) {<br>
+      Values = std::move(RHS.Values);<br>
+    }<br>
----------------<br>
dblaikie wrote:<br>
> Could these be defaulted (maybe even implicitly defaulted)?<br>
These ones are a bit tricky. They could be made default, but then I'd have to un-delete the super class implementations (which I deleted as a standard precaution for polymorphic classes). Maybe I could make the super class functions protected to make sure they're not invoked accidentally ?<br></blockquote><div><br>Yeah, if you want derived classes to be copy/movable in any way, I'd suggest making the base class operations protected and also make the derived classes final (not their operations - let those be implicit). That way someone can't introduce a class derived from the derived classes that can accidentally be sliced by the intermediate class's copy/move ops.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
(The reason I need these constructors in the first place is so I can return the object as a value from the parsing function without resorting to unique_ptrs and such. I did feel it a bit weird while doing it as this isn't standard practice for polymorphic classes, but it seemed like a nice optimization.)<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D43067" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43067</a><br>
<br>
<br>
<br>
</blockquote></div></div>