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
Mixing #include <memory>
and import std.core;
emits error C2668: 'std::_Atomic_wait_direct': ambiguous call to overloaded function
#1384
Comments
Could you also provide code sample, not only error messages? |
Please use the zipped project in Compile project WinDx.IPC.Alpc |
Thank you! I reduced your sample code to this:
STL version
|
any work around so that I can progress ? |
@mediabuff I'm not yet a modules expert - @StephanTLavavej has touched modules, which makes him the closest thing we have to an expert - but I strongly suspect that defining things both in a module and in the global fragment (by including the headers) violates the One Definition Rule. If that's the case, your avenues forward are to either avoid including headers covered by a module imported into the same translation unit, or to avoid using our non-standard library modules and just include headers. |
@cdacamar should know whether this is supported. My understanding is also that you shouldn't mix the experimental STL modules and the classic STL headers - you should use one or the other. |
#include <memory>
and import std.core;
emits error C2668: 'std::_Atomic_wait_direct': ambiguous call to overloaded function
thank you all. But a pratical/transition question though if you can't mix STL modules and STL headers. If I am an author of c++ module - that uses third-party headers - which may include STL headers - what is the transiton path ? |
@StephanTLavavej this scenario should work. Specifically the guidance w.r.t. using modules + textual inclusion is: // #include directives
// import directives
// user source So textual inclusion must always be before module import directives. The initial error observed looks very much like a compiler bug to me. |
Exactly how I had laid out. Agree, seems like a compiler bug. How do to get to VC++ team |
I stand corrected - thanks, @cdacamar!
Please head over to "Report a Problem" at Developer Community and file a bug report, ideally with @fsb4000's minimized repro. |
This bug still exist. |
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(971,1): error C2668: 'std::_Atomic_wait_direct': ambiguous call to overloaded function
1>d:\agent_work\3\s\binaries\x86ret\inc\atomic(394,6): message : could be 'void std::_Atomic_wait_direct<_Ty,_Integral>(const std::_Atomic_storage<_Ty,4> *const ,_Value_type,const std::memory_order) noexcept' [found using argument-dependent lookup]
1> with
1> [
1> _Ty=long,
1> _Integral=long,
1> _Value_type=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(394,6): message : or 'void std::_Atomic_wait_direct<_Ty,_Integral>(const std::_Atomic_storage<_Ty,4> *const ,_Value_type,const std::memory_order) noexcept'
1> with
1> [
1> _Ty=long,
1> _Integral=long,
1> _Value_type=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(971,1): message : while trying to match the argument list '(const std::_Atomic_storage<_Ty,4> *, _Integral, const std::memory_order)'
1> with
1> [
1> _Ty=long
1> ]
1> and
1> [
1> _Integral=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(970): message : while compiling class template member function 'void std::_Atomic_storage<_Ty,4>::wait(const long,const std::memory_order) noexcept const'
1> with
1> [
1> _Ty=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(2855): message : see reference to function template instantiation 'void std::_Atomic_storage<_Ty,4>::wait(const long,const std::memory_order) noexcept const' being compiled
1> with
1> [
1> _Ty=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(1444): message : see reference to class template instantiation 'std::_Atomic_storage<_Ty,4>' being compiled
1> with
1> [
1> _Ty=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(1647): message : see reference to class template instantiation 'std::_Atomic_integral<_Ty,4>' being compiled
1> with
1> [
1> _Ty=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(2143): message : see reference to class template instantiation 'std::_Atomic_integral_facade<_Ty>' being compiled
1> with
1> [
1> _Ty=long
1> ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29331\include\atomic(2880): message : see reference to class template instantiation 'std::atomic' being compiled
The text was updated successfully, but these errors were encountered: