Why can't I initialize a reference in an initializer list with uniform initialization?
问题 That is, why does this: struct S {}; struct T { T(S& s) : s{s} {} S& s; }; int main() { S s; T t{s}; } give me a compiler error with GCC 4.7: test.cpp: In constructor 'T::T(S&)': test.cpp:5:18: error: invalid initialization of non-const reference of type 'S&' from an rvalue of type '<brace-enclosed initializer list>' ? To fix the error, I have to change the s{s} to s(s) . Doesn't this break the, erm, uniformity of uniform initialization? EDIT : I tried with clang, and clang accepts it, so