Skip to content
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

Standard Library Modules: bogus error C2504: 'std::filesystem::_Dir_enum_impl': base class undefined #3333

Closed
StephanTLavavej opened this issue Jan 9, 2023 · 8 comments
Labels
bug Something isn't working compiler Compiler work involved modules C++23 modules, C++20 header units resolved Successfully resolved without a commit

Comments

@StephanTLavavej
Copy link
Member

On Discord, @davidhunter22 provided the following test case which is very similar to #3330, but which isn't helped by @fsb4000's workaround #3331:

D:\GitHub\STL\out\x64>type woof.cpp
import std;

int main() {
    std::filesystem::directory_iterator x{"."};
}
D:\GitHub\STL\out\x64>cl /EHsc /nologo /W4 /std:c++latest /MTd /Od out\modules\std.ixx woof.cpp /Fewoof.exe
std.ixx
woof.cpp
woof.cpp(5): error C2504: 'std::filesystem::_Dir_enum_impl': base class undefined
Generating Code...

I was unable to work around this by adding _EXPORT_STD and/or extern "C++", so it appears that we need to report an additional compiler bug beyond DevCom-10247495.

@StephanTLavavej StephanTLavavej added bug Something isn't working compiler Compiler work involved modules C++23 modules, C++20 header units labels Jan 9, 2023
@StephanTLavavej
Copy link
Member Author

Reported internally as VSO-1715231 "Standard Library Modules: Bogus error C2504: 'std::filesystem::_Dir_enum_impl': base class undefined".

@huangqinjin
Copy link

I also reported C2504 long time ago in DevCom-10091963. No idea if they are same issue.

@StephanTLavavej
Copy link
Member Author

This compiler bug has been fixed for VS 2022 17.6 Preview 2. 🎉

@StephanTLavavej StephanTLavavej added the resolved Successfully resolved without a commit label Jan 18, 2023
@ChemistAion
Copy link

It still appears for std::filesystem::is_empty(...)

Microsoft Visual Studio Community 2022
Version 17.5.0 Preview 6.0

@fsb4000
Copy link
Contributor

fsb4000 commented Feb 17, 2023

@ChemistAion

17.6 Preview 2 > 17.5 Preview 6

17.6 Preview 2 has not been released yet

@ChemistAion
Copy link

ChemistAion commented Feb 17, 2023

@fsb4000: yep, I get it... that part I am missing here with these :hooray: reacts (yours included) - so we are celebrating fix of a regression bug in std::filesystem in VS that is not available yet? ;)

@fsb4000
Copy link
Contributor

fsb4000 commented Feb 17, 2023

Yeah, we like emojis and celebrating anything 😺 🎉

@ChemistAion
Copy link

ack, I joined 🐰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Compiler work involved modules C++23 modules, C++20 header units resolved Successfully resolved without a commit
Projects
None yet
Development

No branches or pull requests

4 participants