-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__msvc_chrono.hpp & type_traits: chrono duration #3992
Comments
This might be caused by internal VSO-1880921. |
The issue must be somewhere in the library itself. Today, I realized that It seems to only happen if you import As an example here: (This module can be used standalone) https://github.com/OmniVortexStudios/ultra/blob/28eb085f7c9675b2c86e5577268c1c509e3e90bd/Source/Library/Ultra/Utility/Timer.ixx If I import I hope that this can help you guys to track down this annoying issue... |
IntelliSense support for modules is a work in progress, and we have not yet enabled STL test coverage. At this time, you should not expect IntelliSense to work at all for modules - then you may be positively surprised if some things happen to work, but you'll never be disappointed. (Not a joke.) |
Yeah, I am aware of that and you're completely right. Anyways this weird issue above (chrono) happens mixing modules with classic headers, and the solution in such case is to sometimes include chrono or to import it as header unit. It depends on something I don't understand. But the error is always the same, the compiler cannot deduce the template parameters or it kills IntelliSense. The crazy thing about it I get sometimes also compiler errors, the internal ones, which than breaks completely my builds. After removing chrono nearly everywhere the most issues are gone and also IntelliSense started working. I also removed global module fragments where possible. Thats why I am suspecting chrono to be the real culprit in both cases. Maybe it can help you guys to track down the issue. Also I tracked down that usings of namespaces can brake IntelliSense, but thats a known issue which is already mentioned in the vs developer community. |
Mixing modules with classic includes is a known bug/limitation that the compiler team is working on. This should also not be expected to work at all at this time. (It's super duper broken, whereas IntelliSense support for modules is only mostly broken.) If you're seeing ICEs involving chrono when using only the named module ICEs are by definition compiler bugs; chrono cannot be the root cause, although it can be a contributing factor. |
Does this still repro with VS 2022 17.10 Preview 7 or later? I improved the STL so that include-before-import (but not the other order) works, with #4154 in VS 2022 17.10 Preview 1. |
Yeah, it's solved, Thank You. |
Describe the bug
It's hard to describe this bug, it seems to depend on a lot of things. I cannot build you guys the perfect test case, sorry, I only try to report something, that had cost me some hours and nerves..., but anyway you can download the whole code and test with it.
I am exclusively using C++20 modules, with /std:c++latest and I tested it on Visual Studio 2022 17.7.2 and 17.8.0 Preview 1.0, but the error occurred since 17.5.x as I remember.
This code is marked as the problem:
It is called over:
In some, not all modules, the compile time error was triggered:
when using my logger...
The issue is simple for you guys, I think, I get the following errors:
Workaround
I found out that a simple
#include <chrono>
in the affected modules fixed the error, so I think it has something to do with Microsoft's STL implementation in combination with C++20 Modules.I couldn't track the issue further, sorry, it is far beyond my knowledge.
Expected behavior
std::chrono::time_pointstd::chrono::system_clock;
--> Should work across module boundaries
Hopefully that makes sense...
STL version
#include <chrono>
in one of the affected modules (also visible in the commit log)Additional context
You can find the affected modules with my marked comment:
Sorry, if i couldn't help you further.
The text was updated successfully, but these errors were encountered: