Skip to content

Commit 3338722

Browse files
committed
NFC: Suppress an unused private member warning in ABI/Task.h.
1 parent 023db15 commit 3338722

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

include/swift/ABI/Task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ static_assert(alignof(Job) == 2 * alignof(void*),
170170
class NullaryContinuationJob : public Job {
171171

172172
private:
173-
AsyncTask* Task;
174-
AsyncTask* Continuation;
173+
SWIFT_ATTRIBUTE_UNUSED AsyncTask *Task;
174+
AsyncTask *Continuation;
175175

176176
public:
177177
NullaryContinuationJob(AsyncTask *task, JobPriority priority, AsyncTask *continuation)

include/swift/Basic/Compiler.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@
9898
#define SWIFT_ATTRIBUTE_NORETURN
9999
#endif
100100

101+
#if __has_attribute(unused)
102+
#define SWIFT_ATTRIBUTE_UNUSED __attribute__((__unused__))
103+
#else
104+
#define SWIFT_ATTRIBUTE_UNUSED
105+
#endif
106+
101107
#ifndef SWIFT_BUG_REPORT_URL
102108
#define SWIFT_BUG_REPORT_URL "https://swift.org/contributing/#reporting-bugs"
103109
#endif

0 commit comments

Comments
 (0)