eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.24k stars 170 forks source link

Compiler crash in Visual Studio 2013 #65

Closed amerry closed 8 years ago

amerry commented 8 years ago

The new streaming stuff causes the Visual Studio causes compiler crashes in Visual Studio 2013 when functions have enum class arguments (eg: see the test case I added in this commit).

I've tried moving around the decltype() specification (eg: putting it before the function - with suitable std::declval uses - in place of the auto, or putting it as an argument), but it seems to be the fact that decltype(s << t) is being used where t is an enum class instance that is causing the issue.

Doing something like

decltype(operator<<(std::decltype<std::ostream&>(), std::decltype<T1>()))

seems to fix the issue, but breaks the unit tests.