From: Jakub Dupak <d...@jakubdupak.com>

gcc/rust/ChangeLog:

        * typecheck/rust-tyty.h: Fix nodiscard to warn unused.

Signed-off-by: Jakub Dupak <d...@jakubdupak.com>
---
 gcc/rust/typecheck/rust-tyty.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h
index 8bfa83da8d8..da4b901724d 100644
--- a/gcc/rust/typecheck/rust-tyty.h
+++ b/gcc/rust/typecheck/rust-tyty.h
@@ -177,7 +177,7 @@ public:
   virtual BaseType *clone () const = 0;
 
   // Check if TyTy::BaseType is of a specific type.
-  template <typename T>[[nodiscard]] bool is () const
+  template <typename T> WARN_UNUSED_RESULT bool is () const
   {
     static_assert (std::is_base_of<BaseType, T>::value,
                   "Can only safely cast to TyTy types.");
-- 
2.42.1

Reply via email to