You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ca7933e
Browse filesBrowse the repository at this point in the historyBrowse files
[libc++] Disable mistakenly enabled optional<T&> constructors for optional<T> (llvm#194446)
Resolvesllvm#194415
- A constructor specifically meant for `optional<T&>` was left enabled
for `optional<T>`
- Fix it, and add a test to check for regression.
- This patch also corrects the constraints for `optional(optional<U>&)`
and `optional(const optional<U>&)` , as they were incorrectly
disallowing [valid conversions](https://godbolt.org/z/1r5Ea7z5M)
- Also, correct the `noexcept` specification.
- Add tests for both corrections.
(cherry picked from commit 239189c)
Copy file name to clipboardExpand all lines: libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ref_constructs_from_temporary.verify.cpp
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -29,12 +29,10 @@ void test() {
29
29
const std::optional<int> co(1);
30
30
std::optional<int> o0(1);
31
31
32
-
// expected-error-re@*:* 10 {{call to deleted constructor of 'std::optional<{{.*}}>'}}
32
+
// expected-error-re@*:* 8 {{call to deleted constructor of 'std::optional<{{.*}}>'}}
0 commit comments