Open 16-Bit-Dog opened 1 year ago
FYI @cdacamar this looks like a compiler bug.
I observe that this works if broken_iter.ixx
says import std;
.
The following imports should not be required though, no?
This is still present in 17.8. I noticed that by replacing #include <compare>
with #include <filesystem>
in your example, there are no errors. Whatever that means.
In my case, the problem occurs when using std::filesystem:exists()
in a member function in a class in module. Indeed, if I replace the content of the functions of your example with std::filesystem::exists(".");
I get the same error. The workaround mentioned above works in this minimal example, but not in my real code.
Using #include <filesystem>
at the module import location (in the global module fragment, if necessary) definitely fixes the issue for me.
Does this still repro with VS 2022 17.10 or later? I improved the STL so that include-before-import (but not the other order) works, with #4154 in VS 2022 17.10.
I can reproduce this problem with VS 2022 17.10.3
Describe the bug
when recursive_directory_iterator or directory_iterator is used inside a modules export block, the following code will compile; if this same code is then wrapped by a struct/class the code will never compile when the method is called with the following issue(s) of 2 depending on the code setup:
missing std::partial_order from
#<compare>
, although if this header is included (which should not be required) the following error will happen insteadCommand-line test case
main.cpp
brokenIter.ixx
compile command:
cl /EHsc /W4 /WX /std:c++latest .\brokenIter.ixx .\main.cpp
Expected behavior
code does not compile with or without
#<compare>
due to struct/class method using recursive_directory_iterator or directory_iterator (if you remove#<compare>
there will be a different compile error which still is not supposed to be there)STL version
Additional context
exact same (minimum reproducible code) I used to get a compile error: https://github.com/16-Bit-Dog/BrokenFileSystemOn17.6
same compiler issue but elaborated upon in relation to #3330