| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
|
| 3 |
// LWG 3585. Variant converting assignment with immovable alternative |
| 4 |
|
| 5 |
#include <variant> |
| 6 |
#include <string> |
| 7 |
|
| 8 |
struct A { |
| 9 |
A() = default; |
| 10 |
A(A&&) = delete; |
| 11 |
}; |
| 12 |
|
| 13 |
int main() { |
| 14 |
std::variant<A, std::string> v; |
| 15 |
v = "hello"; |
| 16 |
} |