The following code does not compile (GCC, clang):
struct outer {
struct inner {
int i = 1;
int j = 2;
};
void foo (const
inner& param =
inner{}) const {}
};
int main() {
outer{}.foo();
}
However, adding a default constructor (with implementation) to inner
solves the issue. Moving out inner
to the namespace scope also helps.
What's the problem here? I'd appreciate references to the standard.