uninitialized const
问题 This compiles perfectly fine with the current MSVC compiler: struct Foo { } const foo; However, it fails to compile with the current g++ compiler: error: uninitialized const 'foo' [-fpermissive] note: 'const struct Foo' has no user-provided default constructor If I provide a default constructor myself, it works: struct Foo { Foo() {} } const foo; Is this another case of MSVC being too permissive, or is g++ too strict here? 回答1: The C++03 Standard: 8.5 [dcl.init] paragraph 9 If no initializer