[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 25 00:25:50 PDT 2025


================
@@ -65,15 +65,31 @@ void GH104391() {
   M; // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
 }
 
+struct S4 get_s_ignored(void) __attribute__((candiscard));
----------------
philnik777 wrote:

There doesn't seem to be any testing for what happens if you add both `candiscard` and `nodiscard` to a function.

https://github.com/llvm/llvm-project/pull/154943


More information about the cfe-commits mailing list