Skip to content

Commit 1a17f20

Browse files
MarcelRaadvprus
authored andcommitted
Compile fix for MSVC 14
Also fixes some new variable shadowing warnings in cmdline_test with Visual C++ 14.
1 parent 6e84659 commit 1a17f20

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/boost/program_options/detail/config_file.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace boost { namespace program_options { namespace detail {
8282

8383
void get();
8484

85-
#if BOOST_WORKAROUND(_MSC_VER, <= 1800)
85+
#if BOOST_WORKAROUND(_MSC_VER, <= 1900)
8686
void decrement() {}
8787
void advance(difference_type) {}
8888
#endif

test/cmdline_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ void test_cmdline(const char* syntax,
126126
try {
127127
vector<option> options = cmd.run();
128128

129-
for(unsigned i = 0; i < options.size(); ++i)
129+
for(unsigned j = 0; j < options.size(); ++j)
130130
{
131-
option opt = options[i];
131+
option opt = options[j];
132132

133133
if (opt.position_key != -1) {
134134
if (!result.empty())
@@ -138,18 +138,18 @@ void test_cmdline(const char* syntax,
138138
if (!result.empty())
139139
result += " ";
140140
result += opt.string_key + ":";
141-
for (size_t j = 0; j < opt.value.size(); ++j) {
142-
if (j != 0)
141+
for (size_t k = 0; k < opt.value.size(); ++k) {
142+
if (k != 0)
143143
result += "-";
144144
result += opt.value[j];
145145
}
146146
}
147147
}
148148
}
149-
catch(unknown_option& e) {
149+
catch(unknown_option&) {
150150
status = s_unknown_option;
151151
}
152-
catch(ambiguous_option& e) {
152+
catch(ambiguous_option&) {
153153
status = s_ambiguous_option;
154154
}
155155
catch(invalid_command_line_syntax& e) {

0 commit comments

Comments
 (0)