For list initialization, if the element of the list has one element (here, w
), and a constructor of a class X
with parameter "reference to const/volatile X" is considered, no user defined conversions are considered. So both the copy and move constructor of foo
cannot be used. So the foo(int)
constructor is unambiguously chosen.
So Clang is correct here.
EDIT: For the Standards folks in here, see 13.3.3.1p4