I recently worked on code, and I came across something unusual in GCC and Clang. Using brace-init triggers a compilation error in gcc, while direct initialization works like &b = a . The code below is a very simple example of the behavior I encountered, and I was wondering why GCC does not compile the code, since none of shared_ptr accepts initializer_list, and a is an lvalue
#include <iostream>
Clang 3.4 compiles this, but GCC 4.8 does not.
source share