[PATCH] D64631: [obj2yaml] - Rework tool's error reporting logic for ELF target.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 01:53:49 PDT 2019
MaskRay added inline comments.
================
Comment at: tools/obj2yaml/elf2yaml.cpp:164
+ if (Error E = dumpSymbols(&Sec, Y->Symbols))
+ return std::move(E);
if (Sec.sh_type == ELF::SHT_DYNSYM)
----------------
grimar wrote:
> MaskRay wrote:
> > `return E;` to avoid clang -Wpessimizing-move (automatic move from lvalues applies here)
> I can't. Otherwise I have the following errors:
> (MVSC 2017)
>
> ```
> elf2yaml.cpp(164): error C2280: 'llvm::Error::Error(const llvm::Error &)': attempting to reference a deleted function
> llvm/Support/Error.h(186): note: see declaration of 'llvm::Error::Error'
> llvm/Support/Error.h(186): note: 'llvm::Error::Error(const llvm::Error &)': function was explicitly deleted
> ```
>
> When I search for "return std::move(" in LLVMs code, I see many similar places.
Sorry, the -Wpessimizing-move warning is on elf2yaml.cpp:394 (where the return type is `Error`), not here (where the return type is `Expected`).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64631/new/
https://reviews.llvm.org/D64631
More information about the llvm-commits
mailing list