This looks like a known g++ bug number 70939:
creating object of abstract class allowed in all versions of g++
g++ compiles ill formed C++ program successfully
class A {
public:
A() {
printf("A()\n");
}
virtual void b() const = 0;
};
int main() {
const A& a{};
a.b();
return 0;
}
Your code does the same thing as this line
const A& a{}
as part of g({})
invocation.