为什么这个使用统一初始化的代码片段用g ++ 4.6而不是g ++ 4.7编译?

x-x*_*x-x 47 c++ gcc g++ uniform-initialization c++11

注意派生使用C++ 11统一初始化语法来调用基类构造函数.

class base
{
    protected:
        base()
        {}
};

class derived : public base
{
    public:
        derived()
            : base{} // <-- Note the c++11 curly brace syntax
                     // using uniform initialization. Change the
                     // braces to () and it works.
        {}
};

int main()
{
    derived d1;

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

g ++ 4.6编译它,但是g ++ 4.7没有:

$ g++-4.7 -std=c++11 -Wall -Wextra -pedantic curly.cpp -o curly
curly.cpp: In constructor ‘derived::derived()’:
curly.cpp:4:13: error: ‘base::base()’ is protected
curly.cpp:19:24: error: within this context
Run Code Online (Sandbox Code Playgroud)

这是怎么回事?

更新1:它也编译没有警告与clang ++ - 3.1
Update 2:看起来像编译器错误肯定.它显然已在GCC 4.7.3中修复.

x-x*_*x-x 4

GCC/libstdc++ 贡献者 Paolo Carlini确认这是一个错误/回归