struct A {
operator long();
};
struct B : A {
operator unsigned() &&;
};
int main() {
int x = B();
}
c3RydWN0IEEgewoJb3BlcmF0b3IgbG9uZygpOwp9OwoKc3RydWN0IEIgOiBBIHsgCglvcGVyYXRvciB1bnNpZ25lZCgpICYmOwp9OwoKaW50IG1haW4oKSB7CglpbnQgeCA9IEIoKTsKfQ==
prog.cpp: In function ‘int main()’:
prog.cpp:10:12: error: conversion from ‘B’ to ‘int’ is ambiguous
int x = B();
^
prog.cpp:10:12: note: candidates are:
prog.cpp:6:2: note: B::operator unsigned int() &&
operator unsigned() &&;
^
prog.cpp:2:2: note: A::operator long int()
operator long();
^
prog.cpp:10:6: warning: unused variable ‘x’ [-Wunused-variable]
int x = B();
^