[llvm] r278298 - [ADT] Move LLVM_ATTRIBUTE_UNUSED_RESULT to the function, otherwise gcc 4.8 complains about it.

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 15:35:39 PDT 2016


Author: timshen
Date: Wed Aug 10 17:35:38 2016
New Revision: 278298

URL: http://llvm.org/viewvc/llvm-project?rev=278298&view=rev
Log:
[ADT] Move LLVM_ATTRIBUTE_UNUSED_RESULT to the function, otherwise gcc 4.8 complains about it.

It's a fix for the original patch r278251.

Modified:
    llvm/trunk/include/llvm/ADT/ScopeExit.h

Modified: llvm/trunk/include/llvm/ADT/ScopeExit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ScopeExit.h?rev=278298&r1=278297&r2=278298&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ScopeExit.h (original)
+++ llvm/trunk/include/llvm/ADT/ScopeExit.h Wed Aug 10 17:35:38 2016
@@ -23,7 +23,7 @@
 namespace llvm {
 namespace detail {
 
-template <typename Callable> class LLVM_ATTRIBUTE_UNUSED_RESULT scope_exit {
+template <typename Callable> class scope_exit {
   Callable ExitFunction;
 
 public:
@@ -44,7 +44,7 @@ public:
 // Interface is specified by p0052r2.
 template <typename Callable>
 detail::scope_exit<typename std::decay<Callable>::type>
-make_scope_exit(Callable &&F) {
+    LLVM_ATTRIBUTE_UNUSED_RESULT make_scope_exit(Callable &&F) {
   return detail::scope_exit<typename std::decay<Callable>::type>(
       std::forward<Callable>(F));
 }




More information about the llvm-commits mailing list