b3fce1bd45
libstdc++-v3/ChangeLog: PR libstdc++/100982 * include/std/optional (optional::operator=(const optional<U>&)): Fix value category used in is_assignable check. * testsuite/20_util/optional/assignment/100982.cc: New test.
18 lines
272 B
C++
18 lines
272 B
C++
// { dg-do compile { target c++17 } }
|
|
|
|
#include <optional>
|
|
|
|
struct U {};
|
|
|
|
struct T {
|
|
explicit T(const U&);
|
|
T& operator=(const U&);
|
|
T& operator=(U&&) = delete;
|
|
};
|
|
|
|
int main() {
|
|
std::optional<U> opt1;
|
|
std::optional<T> opt2;
|
|
opt2 = opt1; // PR libstdc++/100982
|
|
}
|