http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48185
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-18 17:27:43 UTC --- G++ is right a declaration in a selection-statement (if or switch) must be of the form: if ( type-specifier id = initializer ) or in C++0x: if ( type-specifier id { init } ) See 6.4 in the C++ standard