Skip to content

Commit 39cd04e

Browse files
tautschnigromainbrenguier
authored andcommitted
Work around VS2013's lack of constexpr support
Fixes diffblue#531.
1 parent 4656d03 commit 39cd04e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/goto-programs/goto_program_template.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,15 @@ class goto_program_templatet
216216
}
217217

218218
//! Uniquely identify an invalid target or location
219+
#if (defined _MSC_VER && _MSC_VER <= 1800)
220+
// Visual Studio <= 2013 does not support constexpr, making
221+
// numeric_limits::max() unviable for a static const member
222+
static const unsigned nil_target=
223+
static_cast<unsigned>(-1);
224+
#else
219225
static const unsigned nil_target=
220226
std::numeric_limits<unsigned>::max();
227+
#endif
221228

222229
//! A globally unique number to identify a program location.
223230
//! It's guaranteed to be ordered in program order within

0 commit comments

Comments
 (0)