blob: c5713361a4815d277e9f38c5d6d8449cfdbb06e3 [file] [log] [blame]
// PR c++/46831
// { dg-do compile { target c++11 } }
// { dg-options "" }
struct B { };
struct D : B { };
struct A {
template<typename T = void> operator D&();
operator long();
};
template <> A::operator D&(); // { dg-message "template conversion" }
void f(long);
void f(B&);
struct A2 {
template<typename T = void> operator B&();
};
void f2(const B&);
int main() {
f(A());
f2(A2());
f2(A()); // { dg-error "" }
}