@@ -92,10 +92,7 @@ class OptionalStorage {
92
92
}
93
93
94
94
constexpr bool has_value () const noexcept { return hasVal; }
95
- // Workaround to avoid deprecation warnings: rdar://102362022
96
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
97
95
LLVM_DEPRECATED (" Use has_value instead." , " has_value" )
98
- #endif
99
96
constexpr bool hasValue () const noexcept {
100
97
return hasVal;
101
98
}
@@ -314,28 +311,18 @@ template <typename T> class Optional {
314
311
constexpr const T *getPointer () const { return &Storage.value (); }
315
312
T *getPointer () { return &Storage.value (); }
316
313
constexpr const T &value () const & { return Storage.value (); }
317
- // Workaround to avoid deprecation warnings: rdar://102362022
318
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
319
314
LLVM_DEPRECATED (" Use value instead." , " value" )
320
- #endif
321
315
constexpr const T &getValue () const & {
322
316
return Storage.value ();
323
317
}
324
318
T &value () & { return Storage.value (); }
325
- // Workaround to avoid deprecation warnings: rdar://102362022
326
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
327
- LLVM_DEPRECATED (" Use value instead." , " value" )
328
- #endif
329
- T &getValue () & {
319
+ LLVM_DEPRECATED (" Use value instead." , " value" ) T &getValue () & {
330
320
return Storage.value ();
331
321
}
332
322
333
323
constexpr explicit operator bool () const { return has_value (); }
334
324
constexpr bool has_value () const { return Storage.has_value (); }
335
- // Workaround to avoid deprecation warnings: rdar://102362022
336
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
337
325
LLVM_DEPRECATED (" Use has_value instead." , " has_value" )
338
- #endif
339
326
constexpr bool hasValue () const {
340
327
return Storage.has_value ();
341
328
}
@@ -348,10 +335,7 @@ template <typename T> class Optional {
348
335
return has_value () ? value () : std::forward<U>(alt);
349
336
}
350
337
template <typename U>
351
- // Workaround to avoid deprecation warnings: rdar://102362022
352
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
353
338
LLVM_DEPRECATED (" Use value_or instead." , " value_or" )
354
- #endif
355
339
constexpr T getValueOr (U &&alt) const & {
356
340
return has_value () ? value () : std::forward<U>(alt);
357
341
}
@@ -372,11 +356,7 @@ template <typename T> class Optional {
372
356
}
373
357
374
358
T &&value() && { return std::move (Storage.value ()); }
375
- // Workaround to avoid deprecation warnings: rdar://102362022
376
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
377
- LLVM_DEPRECATED (" Use value instead." , " value" )
378
- #endif
379
- T &&getValue() && {
359
+ LLVM_DEPRECATED (" Use value instead." , " value" ) T &&getValue() && {
380
360
return std::move (Storage.value ());
381
361
}
382
362
T &&operator *() && { return std::move (Storage.value ()); }
@@ -385,10 +365,7 @@ template <typename T> class Optional {
385
365
return has_value () ? std::move (value ()) : std::forward<U>(alt);
386
366
}
387
367
template <typename U>
388
- // Workaround to avoid deprecation warnings: rdar://102362022
389
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
390
368
LLVM_DEPRECATED (" Use value_or instead." , " value_or" )
391
- #endif
392
369
T getValueOr (U &&alt) && {
393
370
return has_value () ? std::move (value ()) : std::forward<U>(alt);
394
371
}
@@ -402,10 +379,7 @@ template <typename T> class Optional {
402
379
return None;
403
380
}
404
381
template <class Function >
405
- // Workaround to avoid deprecation warnings: rdar://102362022
406
- #ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
407
382
LLVM_DEPRECATED (" Use transform instead." , " transform" )
408
- #endif
409
383
auto map (const Function &F)
410
384
&& -> Optional<decltype(F(std::move(*this ).value()))> {
411
385
if (*this )
0 commit comments