]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: TyTy: Fix missed nodiscard
authorJakub Dupak <dev@jakubdupak.com>
Sun, 3 Dec 2023 10:13:04 +0000 (11:13 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:49 +0000 (12:36 +0100)
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 8bfa83da8d8b1ff339e826e923d0ac8a42dbade2..da4b901724dbd97b308bb61f9c56b72be6e3c13f 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.");