Recently Why does a const object requires a user-provided default constructor? was marked a duplicate of Why does C++ require a user-provided default constructor to default-
The spec currently requires user-provided default constructors but it appears that GCC is implementing a change based on DR 253 which says that if all sub-objects would be initialized without a user provided default constructor then a user-provided default constructor is not required.
This change is only draft status, has not been accepted yet and is not part of the standard. So I think think this is behavior intended by GCC developers but I'm not sure if this is a conforming extension though.
Here's a change to the first example which causes GCC to produce an error:
class A {
public:
void f() {}
int i;
};
int main()
{
A a; // OK
const A b; // ERROR
a.f();
return 0;
}
Note that gcc downgrades the error to a warning with the -fpermissive flag.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42844