We give two errors here: void f () { int i; extern void g(int x = i); // error extern void h(int x = sizeof(i)); // OK } but [dcl.fct.default]/7 now says "A local variable cannot be odr-used ([basic.def.odr]) in a default argument." This is https://wg21.link/cwg2082
Will be fixed by https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576627.html
Could PR 50479 be related?
Fixed in GCC 11.