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:
parent
dd7813f05d
commit
62ecd2b8d4
22
gcc/testsuite/g++.dg/overload/conv-op4.C
Normal file
22
gcc/testsuite/g++.dg/overload/conv-op4.C
Normal 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{});
|
||||
}
|
Loading…
Reference in New Issue
Block a user