Skip to content

Commit 504cba9

Browse files
authored
CDRIVER-5996 Address EVG task failure due to possible VS 2017 compiler bug (#2041)
* CDRIVER-6043 clarify description of compound literal issues with VS 2017
1 parent b67b02f commit 504cba9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/common/tests/test-mlib.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,17 @@ _test_cmp (void)
315315
// mlib_cmp produces the correct answer:
316316
ASSERT (mlib_cmp (-27, <, 20u));
317317

318+
// CDRIVER-6043: until VS 2019 (MSVC 19.20), compound literals seem to "escape" the expression or scope they are
319+
// meant to be in. This includes the compound literals used by the conditional operator in mlib_upsize_integer.
320+
#if !defined(_MSC_VER) || _MSC_VER >= 1920
318321
{
319322
// Check that we do not double-evaluate the operand expression.
320323
intmax_t a = 4;
321324
mlib_check (mlib_cmp (++a, ==, 5));
322325
// We only increment once:
323326
mlib_check (a, eq, 5);
324327
}
328+
#endif
325329
}
326330

327331
static void

0 commit comments

Comments
 (0)