c++: Add fixed test [PR81952]

This was fixed by r258755:
PR c++/81311 - wrong C++17 overload resolution.

	PR c++/81952

gcc/testsuite/ChangeLog:

	* g++.dg/overload/conv-op4.C: New test.
This commit is contained in:
Marek Polacek 2022-05-13 19:45:03 -04:00
parent dd7813f05d
commit 62ecd2b8d4

View File

@ -0,0 +1,22 @@
// PR c++/81952
// { dg-do run { target c++11 } }
template <class T>
struct opt {
opt() { }
opt(opt const& ) { __builtin_abort (); }
opt(opt&& ) { __builtin_abort (); }
template <class U>
opt(U&& ) { }
};
struct foo
{
explicit operator opt<int>() { __builtin_abort (); return {}; }
};
int main()
{
opt<int> o(foo{});
}