http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58317
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
You're wrong, the variable's name is in scope following it's declarator, so
it's syntactically valid and should be accepted by a conforming compiler. It
is a bug that there's no warning but that's already recorded elsewhere in
Bugzilla.
For a valid program that refers to a variable during its initialization
consider:
struct A {
static int f() { return 0; }
A(int) { }
};
int main() {
A a(a.f());
}