apiaryio / drafter

API Blueprint Parser (C++)
https://apiblueprint.org/
MIT License
301 stars 54 forks source link

Compatibility with MSVC 2019 #738

Closed kylef closed 5 years ago

kylef commented 5 years ago

https://github.com/apiaryio/drafter/pull/726 breaks compatibility with MSVC 2019, after this PR the following build error occurs:

ext\snowcrash\src\Just.h(21, 26): error C2131:  expression did not evaluate to a constant

Somewhere else higher up in the build log I've also seen:

ext\snowcrash\src\Just.h(21, 1): error C2440:  'noexcept': cannot convert from 'T' to 'bool
...
ext\snowcrash\src\Just.h(21, 26): message :  No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
kylef commented 5 years ago

I am not entirely sure if it is related, Protagonist tests are currently crashing on MSVC 2015 after the same PR. As noexcept takes a boolean, perhaps when T isn't boolean, this was compiling on older MSVC and could cause a runtime crash (access violation). The tests in Drafter are however passing on MSVC 2015 and MSVC 2017.