sgraenitz requested changes to this revision.
sgraenitz added a comment.
This revision now requires changes to proceed.

First of all, yes the existing code is incorrect. Thanks for looking into this. 
However, I am afraid this isn't the right solution.

In the `if` body you can not `std::move()` from `err` twice. I guess we have to 
do something like:

  if (log)
    LLDB_LOG(...)
  else
    consumeError(...)



> which resulted in a check failure under LLVM_ENABLE_ABI_BREAKING_CHANGES

You probably mean `LLVM_ENABLE_ABI_BREAKING_CHECKS`? For `Error` this enables 
logic to make sure the error was checked: 
https://github.com/llvm/llvm-project/blob/release/16.x/llvm/include/llvm/Support/Error.h#L724
 I think your observation is a side effect of the issue you look at and has 
nothing to do with compiler optimizations like NRVO. If logging is off, the 
error isn't consumed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147669/new/

https://reviews.llvm.org/D147669

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

Reply via email to