-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!modulesC++23 modules, C++20 header unitsC++23 modules, C++20 header units
Description
The following code compiles OK when using the <filesystem> header but fails when using import std;. This is with 17.5 Preview 2. The only changes to a default C++ project in VS was /std:c++latest and adding the std.ixx file
import std;
// #include <filesystem>
int main( )
{
for (auto a : std::filesystem::directory_iterator( "C:\\" )) { }
return 0;
}
The error message when using the std module is
1>C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\type_traits(2102,13): error C2678: binary '&': no operator found which takes a left-hand operand of type '_Bitmask' (or there is no acceptable conversion)
1> with
1> [
1> _Bitmask=__std_fs_file_attr
1> ]
1>C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\cstddef(49,39): message : could be 'std::byte std::operator &(const std::byte,const std::byte) noexcept'
1>C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.35.32124\include\type_traits(2102,13): message : while trying to match the argument list '(_Bitmask, _Bitmask)'
1> with
1> [
1> _Bitmask=__std_fs_file_attr
1> ]
1>C:\Users\david\devel\bugs\mudule_filesystem\Project1\Test.cpp(10,1): message : see reference to function template instantiation 'bool std::_Bitmask_includes_any<__std_fs_file_attr>(_Bitmask,_Bitmask) noexcept' being compiled
1> with
1> [
1> _Bitmask=__std_fs_file_attr
1> ]
1>Done building project "Project1.vcxproj" -- FAILED.
Which seemed really odd to me.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!modulesC++23 modules, C++20 header unitsC++23 modules, C++20 header units