struct A { A(int);};
struct B { explicit B(A); B(const B&);};
B b({0});
I asked a question Permission overload got a different result between gcc and clang , and @Johannes Schaub-litb explained the rules that are active. But I still have some questions about 13.3.3.1.4 Link Binding .
N4527 13.3.3.1.5 [over.ics.list] p1 and p8
1 If the argument - this is a list of initializers (8.5.4), this is not an expression , and special rules are used for conversion to the type of parameter.
8 Otherwise, if the parameter is a reference, see 13.3.3.1.4.
13.3.3.1.4 [over.ics.ref] p1 and p2
1 (8.5.3) , - , , , (13.3.3.1). [...]
-, (13.3.3.1.2), , , , , .
2 , , 13.3.3.1. . .
1: "" ? . 13.3.3.1.5 [over.ics.list] p1
1.3.2 [defns.argument]
< function call expression > , , (5.2.2)
8.5 [dcl.init] p17
17 . - , , - . (, ), .
(17.1). ( ) -init-list, (8.5.4).
(17.2) - , . 8.5.3.
8.5.3 [dcl.init.ref] p5
"cv1 T1" "cv2 T2" :
[...]
(5.2.2.2) - "cv1 T1" (8.5) . .
[...]
, (.. ), .
2. " " , ? , " ", ?
. " " - 8.5.3, 8.5 p17.1, "initializer - " - 8.5.4, 8.5 p17.2
struct X{};
struct Y{Y(X);};
const Y& y1 = X();
const Y& y2 = {X()};
struct Z{operator X();};
const X& x1 = Z();
const X& x2 = {Z()};
struct A{operator int();};
const int& a1 = A();
const int& a2 = {A()};
struct B{B(int);};
const B& b1 = 1;
const B& b2 = {1};
int i3 = 2;
double&& rrd3 = i3;
struct A { A(int);};
struct B { explicit B(A); B(const B&);};
B b({0});
3 ( ):
, , 13.3.3.1.5 [over.ics.list] p8 13.3.3.1.4 [over.ics.ref], . , . , " " "" " ".
, , , ?
. . , .
struct A { A(int);};
struct B { explicit B(A); B(const B&);};
B b1(0);
A a;
B b2(a)
B b3({0})
B b3({a})