A co-worker accidentally wrote code like this:
struct foo {
  foo() : baz(foobar) {}
  enum bar {foobar, fbar, foob};
  bar baz;
};
void f() {
  for( auto x : { foo::foobar,
                  foo::fbar,
                  foo::
                  foo::
                  foo::foob } );
    // ...
}
GCC 5.1.0 compiles this.
What's the rule that makes this compile?
 
     
    