public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8597] gccrs: TyTy: Fix missed nodiscard
@ 2024-01-30 12:00 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-30 12:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ed198edc9bfc17b4c2356068623aa31bda4e1ee7

commit r14-8597-ged198edc9bfc17b4c2356068623aa31bda4e1ee7
Author: Jakub Dupak <dev@jakubdupak.com>
Date:   Sun Dec 3 11:13:04 2023 +0100

    gccrs: TyTy: Fix missed nodiscard
    
    gcc/rust/ChangeLog:
    
            * typecheck/rust-tyty.h: Fix nodiscard to warn unused.
    
    Signed-off-by: Jakub Dupak <dev@jakubdupak.com>

Diff:
---
 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 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 <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.");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-30 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30 12:00 [gcc r14-8597] gccrs: TyTy: Fix missed nodiscard Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).