From: Jakub Dupak Date: Sun, 3 Dec 2023 10:13:04 +0000 (+0100) Subject: gccrs: TyTy: Fix missed nodiscard X-Git-Tag: basepoints/gcc-15~1542 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed198edc9bfc17b4c2356068623aa31bda4e1ee7;p=thirdparty%2Fgcc.git gccrs: TyTy: Fix missed nodiscard gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Fix nodiscard to warn unused. Signed-off-by: Jakub Dupak --- diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 8bfa83da8d8b..da4b901724db 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 [[nodiscard]] bool is () const + template WARN_UNUSED_RESULT bool is () const { static_assert (std::is_base_of::value, "Can only safely cast to TyTy types.");