I recently came across this code:
struct Foo{}; int main() { Foo a;
It compiles with g ++ 5.1, but does not work in clang ++ (it uses both -std=c++11 and -std=c++14 , the same results). The reason is that clang ++ outputs type b as std::initializer_list<Foo> , while g++5.1 outputs as Foo . AFAIK, the type really needs to be (intuitive) std::initializer_list here . Why is g ++ 5 inferring a type like Foo ?
c ++ c ++ 11 clang ++ auto gcc5
vsoftco May 2 '15 at 9:28 pm 2015-05-02 21:28
source share