asio::coroutine is implemented in terms of __COUNTER__ under MSVC. If you define such coroutines in header-only code, and include the headers in several translation units, every TU will have a different definition of the function (as __COUNTER__ may have different values), effectively causing an ODR violation.
This has been a silent issue for some time already, but it's starting to manifest under some circumstances with MSVC under release builds.
asio::coroutine
is implemented in terms of__COUNTER__
under MSVC. If you define such coroutines in header-only code, and include the headers in several translation units, every TU will have a different definition of the function (as__COUNTER__
may have different values), effectively causing an ODR violation.This has been a silent issue for some time already, but it's starting to manifest under some circumstances with MSVC under release builds.