[llvm] c2d293e - Compiler.h: remove unused LLVM_NODISCARD

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 11:06:29 PDT 2022


Author: Fangrui Song
Date: 2022-08-11T11:06:24-07:00
New Revision: c2d293ea25ccff560bcb32a7d60b102bf9a8426f

URL: https://github.com/llvm/llvm-project/commit/c2d293ea25ccff560bcb32a7d60b102bf9a8426f
DIFF: https://github.com/llvm/llvm-project/commit/c2d293ea25ccff560bcb32a7d60b102bf9a8426f.diff

LOG: Compiler.h: remove unused LLVM_NODISCARD

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D131695

Added: 
    

Modified: 
    llvm/include/llvm/Support/Compiler.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 8a79d19e446e..c4cfea1fb3c8 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -144,23 +144,6 @@
 #define LLVM_DEPRECATED(MSG, FIX) [[deprecated(MSG)]]
 #endif
 
-/// LLVM_NODISCARD - Warn if a type or return value is discarded.
-
-// Use the 'nodiscard' attribute in C++17 or newer mode.
-#if defined(__cplusplus) && __cplusplus > 201402L && LLVM_HAS_CPP_ATTRIBUTE(nodiscard)
-#define LLVM_NODISCARD [[nodiscard]]
-#elif LLVM_HAS_CPP_ATTRIBUTE(clang::warn_unused_result)
-#define LLVM_NODISCARD [[clang::warn_unused_result]]
-// Clang in C++14 mode claims that it has the 'nodiscard' attribute, but also
-// warns in the pedantic mode that 'nodiscard' is a C++17 extension (PR33518).
-// Use the 'nodiscard' attribute in C++14 mode only with GCC.
-// TODO: remove this workaround when PR33518 is resolved.
-#elif defined(__GNUC__) && LLVM_HAS_CPP_ATTRIBUTE(nodiscard)
-#define LLVM_NODISCARD [[nodiscard]]
-#else
-#define LLVM_NODISCARD
-#endif
-
 // Indicate that a non-static, non-const C++ member function reinitializes
 // the entire object to a known state, independent of the previous state of
 // the object.


        


More information about the llvm-commits mailing list