I have changed my opinion, after reading standart draft. It says: > The range-based for statement > for ( for-range-declaration : expression ) statement > is equivalent to > { > auto && __range = ( expression ); > for ( auto __begin = begin-expr, __end = end-expr; __begin != __end; ++__begin ) > { > for-range-declaration = *__begin; > statement > } >} So formally `i' is unused variable in my case. On 30 August 2011 20:34, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: > Jonathan Wakely <jwakely.gcc@xxxxxxxxx> writes: > >> You could file an enhancement request in Bugzilla requesting that the >> warning is disabled for the variable in the for-range-declaration. > > Personally I think this is the way to go. The variable is implicitly > used, and the warning should reflect that. > > Ian > -- Павел Сергеев