mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Add explicit (void) cast to unused unique_ptr::release() results
Summary: This patch adds explicit `(void)` casts to discarded `release()` calls to suppress -Wunused-result. This patch fixes *all* warnings are generated as a result of [applying `[[nodiscard]]` within libc++](https://reviews.llvm.org/D26596). Similar fixes were applied to Clang in r286796. Reviewers: chandlerc, dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26598 llvm-svn: 286797
This commit is contained in:
parent
418036a955
commit
06ef288680
@ -40,7 +40,7 @@ public:
|
||||
T *ConcreteSymbol = dyn_cast<T>(Symbol.get());
|
||||
if (!ConcreteSymbol)
|
||||
return nullptr;
|
||||
Symbol.release();
|
||||
(void)Symbol.release();
|
||||
return std::unique_ptr<T>(ConcreteSymbol);
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,9 @@ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
|
||||
std::unique_ptr<MemoryBuffer> Owner(unwrap(MemBuf));
|
||||
Expected<std::unique_ptr<Module>> ModuleOrErr =
|
||||
getOwningLazyBitcodeModule(std::move(Owner), Ctx);
|
||||
Owner.release();
|
||||
// Release the buffer if we didn't take ownership of it since we never owned
|
||||
// it anyway.
|
||||
(void)Owner.release();
|
||||
|
||||
if (Error Err = ModuleOrErr.takeError()) {
|
||||
std::string Message;
|
||||
|
Loading…
Reference in New Issue
Block a user