Skip to content

Commit 441b41f

Browse files
authored
Merge pull request #6988 from etcwilde/ewilde/revert-removal-of-deprecation-warning
Revert "rebranch: temporarily disable deprecation warnings for `Optional` in swift sources"
2 parents 4c432c4 + d646bf8 commit 441b41f

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

llvm/include/llvm/ADT/Optional.h

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ class OptionalStorage {
9292
}
9393

9494
constexpr bool has_value() const noexcept { return hasVal; }
95-
// Workaround to avoid deprecation warnings: rdar://102362022
96-
#ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
9795
LLVM_DEPRECATED("Use has_value instead.", "has_value")
98-
#endif
9996
constexpr bool hasValue() const noexcept {
10097
return hasVal;
10198
}
@@ -314,28 +311,18 @@ template <typename T> class Optional {
314311
constexpr const T *getPointer() const { return &Storage.value(); }
315312
T *getPointer() { return &Storage.value(); }
316313
constexpr const T &value() const & { return Storage.value(); }
317-
// Workaround to avoid deprecation warnings: rdar://102362022
318-
#ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
319314
LLVM_DEPRECATED("Use value instead.", "value")
320-
#endif
321315
constexpr const T &getValue() const & {
322316
return Storage.value();
323317
}
324318
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() & {
330320
return Storage.value();
331321
}
332322

333323
constexpr explicit operator bool() const { return has_value(); }
334324
constexpr bool has_value() const { return Storage.has_value(); }
335-
// Workaround to avoid deprecation warnings: rdar://102362022
336-
#ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
337325
LLVM_DEPRECATED("Use has_value instead.", "has_value")
338-
#endif
339326
constexpr bool hasValue() const {
340327
return Storage.has_value();
341328
}
@@ -348,10 +335,7 @@ template <typename T> class Optional {
348335
return has_value() ? value() : std::forward<U>(alt);
349336
}
350337
template <typename U>
351-
// Workaround to avoid deprecation warnings: rdar://102362022
352-
#ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
353338
LLVM_DEPRECATED("Use value_or instead.", "value_or")
354-
#endif
355339
constexpr T getValueOr(U &&alt) const & {
356340
return has_value() ? value() : std::forward<U>(alt);
357341
}
@@ -372,11 +356,7 @@ template <typename T> class Optional {
372356
}
373357

374358
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() && {
380360
return std::move(Storage.value());
381361
}
382362
T &&operator*() && { return std::move(Storage.value()); }
@@ -385,10 +365,7 @@ template <typename T> class Optional {
385365
return has_value() ? std::move(value()) : std::forward<U>(alt);
386366
}
387367
template <typename U>
388-
// Workaround to avoid deprecation warnings: rdar://102362022
389-
#ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
390368
LLVM_DEPRECATED("Use value_or instead.", "value_or")
391-
#endif
392369
T getValueOr(U &&alt) && {
393370
return has_value() ? std::move(value()) : std::forward<U>(alt);
394371
}
@@ -402,10 +379,7 @@ template <typename T> class Optional {
402379
return None;
403380
}
404381
template <class Function>
405-
// Workaround to avoid deprecation warnings: rdar://102362022
406-
#ifndef SWIFT_LLVM_SUPPORT_IS_AVAILABLE
407382
LLVM_DEPRECATED("Use transform instead.", "transform")
408-
#endif
409383
auto map(const Function &F)
410384
&& -> Optional<decltype(F(std::move(*this).value()))> {
411385
if (*this)

0 commit comments

Comments
 (0)