Consider the following example:
class X;
void f(const X &);
void g()
{
X x;
f({x});
}
Does standard require that an implementation ignored curly braces in that case? Without any optimization involved. If yes, than since which version?
On a first glance, it looks like by rules there should be a temporary created - completely unnecessary, of course, but still. Looking at list initialization I cannot find anything relevant. X is not an aggregate here.
Both GCC and Clang, even with -O0, produce code without temporary created - even if an X copy constructor has observable side-effects and even if X has X(std::initializer_list<X>) constructor.