sammccall added inline comments.

================
Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:124
+// A CompileCommand that can be applied to another file. Any instance of this
+// object is invalid after std::move() from it.
 struct TransferableCommand {
----------------
ilya-biryukov wrote:
> jfb wrote:
> > This comment about `move` isn't really saying anything. Also, it's valid 
> > but unspecified (in the case of STL things). I'd drop it.
> We specifically assert that object cannot be called after `move()` (check the 
> unique_ptr that stores our `once_flag`). It's definitely undefined behavior 
> to call any methods, because they will immediately dereference a null pointer 
> (the aforementioned unique_ptr).
> 
> Happy to drop the comment, though, we do have asserts for that.
I think the idea is "this comment just reiterates standard C++ semantics".

(FWIW I find the asserts hurt readability - it's unusual to try to detect this 
condition, and TraitsComputed is easily mistaken for a boolean)


Repository:
  rC Clang

https://reviews.llvm.org/D51314



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to