Skip to content

Commit

Permalink
Fix build with gcc 7.5 by adding a "redundant move"
Browse files Browse the repository at this point in the history
The constructor of Expected<T> expects as T&&, but gcc-7.5 does not
infer an rvalue in this context apparently.
  • Loading branch information
joker-eph committed Mar 18, 2020
1 parent 85334b0 commit f3e297d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) {
[](ThreadSafeModule TSM,
const MaterializationResponsibility &R) -> Expected<ThreadSafeModule> {
TSM.withModuleDo([](Module &M) { dbgs() << "---Compiling---\n" << M; });
return TSM;
return std::move(TSM); // Not a redundant move: fix build on gcc-7.5
});

// (3) Create stubs and call-through managers:
Expand Down
2 changes: 1 addition & 1 deletion llvm/examples/ThinLtoJIT/ThinLtoJIT.cpp
Expand Up @@ -191,7 +191,7 @@ Expected<ThreadSafeModule> ThinLtoJIT::setupMainModule(StringRef MainFunction) {
}

if (auto TSM = GlobalIndex->parseModuleFromFile(*M))
return TSM;
return std::move(TSM); // Not a redundant move: fix build on gcc-7.5

return createStringError(inconvertibleErrorCode(),
"Failed to parse main module");
Expand Down

0 comments on commit f3e297d

Please sign in to comment.