Closed gregkalata closed 1 year ago
OK. Good, I think. Can you explain what problem this solves? Can you add a test that fails on MSVC without it?
I have added a test case that should not compile on MSVC. The problem boils down to the way MSVC expands __VA_ARGS__
. I've encountered it when using .IN_SEQUENCE
macro. With one or two sequences it works fine, but with third one it causes a compile error. For example:
.IN_SEQUENCE(seq3, seq2, seq1);
will cause the following error:
trompeloeil\test\compiling_tests_11.cpp(304,1): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'trompeloeil::sequence_matcher::init_type'
trompeloeil\test\compiling_tests_11.cpp(304,1): message : No constructor could take the source type, or constructor overload resolution was ambiguous
The issue with macro expansion was discussed on SO and a workaround was suggested there. The issue goes away as well if you specify /Zc:preprocessor
argument, but in my codebase it caused loads of issues in many places, so I decided to use the workaround instead.
Thank you! Much appreciated.
Codecov Report
97.99% <ø> (ø)