[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 24 18:05:21 PDT 2025
================
@@ -8,16 +8,26 @@
using NI [[nodiscard]] = int; // expected-warning {{'[[nodiscard]]' attribute ignored when applied to a typedef}}
using WURI [[clang::warn_unused_result]] = int;
+using EIgnored [[clang::candiscard]] = E;
+using NIIgnored [[clang::candiscard]] = NI;
+using WURIgnored [[clang::candiscard]] = WURI;
+
@interface INTF
- (int) a [[nodiscard]];
+ (int) b [[nodiscard]];
- (expected<int>) c;
+ (expected<int>) d;
- (E) e;
+- (EIgnored) e_ignored;
+- (E) e_ignored2 [[clang::candiscard]];
----------------
halbi2 wrote:
Yes, same as `[[nodiscard]]`.
https://github.com/llvm/llvm-project/pull/154943
More information about the cfe-commits
mailing list