C++11 in gcc 4.8.1: list-initialization for copy constructor doesn't work

后端 未结 3 960
醉话见心
醉话见心 2021-01-02 07:33

I encourages with this problem: If I have

class A
{
public:
};
int main()
{
   A a{};
   A b{a};
}

gcc gives:

moves.

3条回答
  •  萌比男神i
    2021-01-02 07:59

    GCC was following the standard, but that was a known defect, see core issue 1467. The defect report was resolved in November 2014 and the new behaviour is supported in the next major release of GCC (version 5.1, released April 2015).

提交回复
热议问题