Why does this snippet using uniform initialization compile with g++4.6 but not g++4.7?
问题 Note that derived uses C++11 uniform initialization syntax to call the base class constructor. 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; } g++4.6 compiles this, however g++4.7 does not: $ g++-4.7 -std=c++11 -Wall -Wextra -pedantic curly.cpp -o curly curly.cpp: In constructor ‘derived: