これは GCC のバグだな
struct Source;
struct Target
{
Target() = default;
Target(Source const&){
std::printf("OK\n");
value = 0;
}
int value = -1;
};
struct Source
{
operator Target(){
std::printf("Bad\n");
Target target;
target.value = 1;
return target;
}
};
int main()
{
Source source;
Target target{source};
std::printf("v = %d\n", target.value);
}