]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
TyTy: Fix missed nodiscard
authorJakub Dupak <dev@jakubdupak.com>
Sun, 3 Dec 2023 10:13:04 +0000 (11:13 +0100)
committerPhilip Herron <philip.herron@embecosm.com>
Tue, 19 Dec 2023 17:23:09 +0000 (17:23 +0000)
gcc/rust/ChangeLog:

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

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
gcc/rust/typecheck/rust-tyty.h

index 212ebc9757044fb1579d6c76f58cc164b8096f44..2e188c2027c35da5523fdeba3fef7d46c0925e1a 100644 (file)
@@ -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.");