Opened 6 years ago

#12715 new Bugs

nested BOOST_FOREACH: MSVC 14.0 Update 3 warning issued

Reported by: timo.euler@… Owned by: Eric Niebler
Milestone: To Be Determined Component: foreach
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Nested usage of BOOST_FOREACH issues the warnings:

  • warning C4456: declaration of '_foreach_col' hides previous local declaration
  • warning C4456: declaration of '_foreach_cur' hides previous local declaration
  • warning C4456: declaration of '_foreach_end' hides previous local declaration
  • warning C4456: declaration of '_foreach_continue' hides previous local declaration

Example code:

#include <boost/foreach.hpp>
int main() {
	std::vector<int> iv(10);
	BOOST_FOREACH(int &i, iv) {
		std::vector<int> iv2(10);
		BOOST_FOREACH(int &i2, iv2) {
			i2 = 2;
		}
		i = 1;
	}
}

Change History (0)

Note: See TracTickets for help on using tickets.