You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When attempting to inject a service dependency into another service within a C++ project using MSVC compiler, the compiler generates a warning C4702: unreachable code during compilation. This warning occurs specifically in virtual_injected class.
Expected behavior
The code should compile without triggering any warnings related to unreachable code (warning C4702).
Desktop (please complete the following information):
OS: Windows
Compiler: MSVC
Version: 19.38.33135
Additional context
I tried to figure out if the problem is with kangaru or MSVC, but couldn't recreate it with a similar class as virtual_injected. I assume it might be because of the optimization in Release.
It would be great if you could have a look at it to determine if this is really from kangaru or MSVC, or between the chair and the keyboard.
The text was updated successfully, but these errors were encountered:
After looking at it, I can say that I'm almost certain this is a false positive. I would report this to the MSVC team. Those function does not throw and does not use control flow. I cannot see how those could have unreachable code.
I also noticed injected from injected.hpp also show this issue there:
The workaround would be to compile with kangaru as a system header (I don't think MSVC supports this) or to compile without /WX or with /W3 instead of /W4.
Describe the bug
When attempting to inject a service dependency into another service within a C++ project using MSVC compiler, the compiler generates a
warning C4702: unreachable code
during compilation. This warning occurs specifically invirtual_injected
class.kangaru/include/kangaru/detail/injected.hpp
Line 59 in 329989a
To Reproduce
CMakeLists.txt
with the following content:Main.cpp
file with the following content:Release
.Expected behavior
The code should compile without triggering any warnings related to unreachable code (
warning C4702
).Desktop (please complete the following information):
Additional context
I tried to figure out if the problem is with kangaru or MSVC, but couldn't recreate it with a similar class as
virtual_injected
. I assume it might be because of the optimization inRelease
.It would be great if you could have a look at it to determine if this is really from kangaru or MSVC, or between the chair and the keyboard.
The text was updated successfully, but these errors were encountered: