Why is this only an error in C++
As others commented above, C and C++ are different languages.
Specifically C++ is very different when it comes to creation and destruction of objects (having constructors and destructors).
Also the support for exceptions and stack unwinding makes things a lot more complicated.
Because of these (and possibly additional reasons) it makes sense to me to disallow edge cases that can complicates things unnecessarily.
And so it is invalid in C++.
is there a way I can tell GCC/Clang to allow it?
I don't think so.
But as a workaround (as @Jarod42 commented), you can enclose the definition and initialization of a in a block. This will makes it valid in C++:
int foo() {
goto lbl;
{ // <- block start
int a = 4;
} // <- block end
lbl:
return 5;
}