Open StephanTLavavej opened 3 years ago
Great to see the note that std lib modules are ready for production use (as of VS2022 17.5, MSVC only). Does that mean that the statement shown here in the documentation about not using preview releases in production code, should be removed? https://learn.microsoft.com/en-us/cpp/cpp/tutorial-import-stl-named-module?view=msvc-170#prerequisites
:page_facing_up: Documentation
std
andstd.compat
:construction: Status
We've reported the following compiler bugs; this issue is for tracking the status of these compiler bugs and removing workarounds/adding test coverage as compiler fixes are released.
As
/clr
C++20 support is a work in progress, we are not yet testing Standard Library Header Units under/clr
.:x: Clang
:bug: EDG (IntelliSense Front-End)
:beetle: Active, UCRT
static inline
functions cannot be called when using modules":lady_beetle: Active, C1XX (MSVC Front-End)
3661
std
module to export too much stuff.pair(piecewise_construct_t, tuple, tuple)
"std::format
in a module requires including<format>
header in .cpp files using that module"std::stacktrace
":grey_question: Possible Improvements (C1XX/MSBuild)
import std.compat;
,std::printf
, orstd::cout
"import std;
is seen, butstd.ifc
/std.obj
need to be built"import std;
andimport std.compat;
":hammer_and_wrench: Upcoming Improvements (C1XX)
:adhesive_bandage: Permanent Workarounds
std::projected::operator*()
error LNK2019: unresolved external symbol"abort()
.:heart_eyes_cat: Fixed, Workaround Removed
'std::pointer_traits<_Voidptr>'
: more than one partial specialization matches the template argument list"__pragma(warning(disable : 4996))
doesn't take effect"'std::char_traits'
"std::_Yarn<char>::operator=(char const *)
already defined"std::optional
,c1xx!FindConversionFunctions()
assertion failed:PF_ISSET(ParsingClassTemplateDefn)
"std::variant
,c1xx!Module::InterfaceReader::materialize_function()
assertion failed"'std::ranges::operator =='
: a trailingrequires
clause is only allowed on a templated function"/headerUnit:angle
ICEs"queue
'sfriend bool operator==
"/headerUnit:angle vector=vector.ifc
header-units.json
via/sourceDependencies:directives
and/translateInclude
/exportHeader /headerName:angle algorithm type_traits vector
_Nontrivial_dummy_type
's constructor"type_info
's equality operator"<format>
as a header unit"_CrtGetAllocHook
emits warning C5106: macro redefined with different parameter names"convertible_to
constrains a constructor"<ranges>
compiler assertion:previous_element == tokenInputStack.TopOfStack()
, aliastemplates.cpp 1010"template <int = 0>
tovformat()
emits warnings C4265 and C4365"#pragma warning
doesn't always suppress warnings in templates"/scanDependencies
generates incorrect"logical-name"
in JSON output"fatal error C1116: unrecoverable error importing module
, with<concepts>
"fatal error C1116: unrecoverable error importing module ''
"error C2672: 'count_if': no matching overloaded function found
"chrono::days
emits bogus error C2131"<chrono>
emits fatal error C1116: unrecoverable error importing header unit'<chrono>'
"std.ixx
emits fatal error C1011: cannot locate standard module interface"extern "C"
function declarations takingextern "C"
types emit bogus error LNK2019: unresolved external symbol"extern "C"
function mentioning entity with module linkage is being marked with module linkage"Module::InterfaceReader::materialize_function<Module::helpers::MemberBuilder>()
"construct_at
SFINAE causes Modules bogus error C2660: 'operator new': function does not take 3 arguments"<codecvt>
: fatal error C1001: Internal compiler error.<any>
: error C2679: binary'!='
: no operator found which takes a right-hand operand of type'const type_info'
(or there is no acceptable conversion)<memory>
: error C2679: binary'=='
: no operator found which takes a right-hand operand of type'const type_info'
(or there is no acceptable conversion)<functional>
: error C2027: use of undefined type'type_info'
<typeinfo>
: error C2872:'type_info'
: ambiguous symbol<typeindex>
: error C2440: 'initializing': cannot convert from 'initializer list' to'std::type_index'
<regex>
: Assertion failed:Nerrors > 0
, fileD:\msvc\src\vctools\Compiler\CxxFE\sl\p1\c\trees.c
/d1ifcInlineFunctions
asserts(bits::rep(typeEncoding.basicEncoding_) & 0x0000000F) != 0
forprintf(_Format, ...)
"<expected>
ICEs withAssertion failed: IsInClassDefn()
"'_Iterator_base12'
: the symbol to the left of a'::'
must be a type"operator&
"inline constexpr
variables forranges::views
emiterror LNK2019: unresolved external symbol
"'memcpy_s'
because it has internal linkage"extern "C++"
is directly applied to a class with a static member function"std::views::join_with
"variant
with inheriting constructors"chunk_view
of input iterators"inserted
, file template.cpp, line 10275"IsInClassDefn() && (region->owner == SU_TAG)
, file reader.cpp, line 2592"3112 DevCom-10154236 "
<fstream>
: Importing as a header unit leads to error C2079: undefined class'std::basic_ofstream<char,std::char_traits<char>>'
"destroy_at()
emits bogus error C2131: expression did not evaluate to a constant"iota_view
emits bogus error C7608: atomic constraint should be a constant expression"constexpr vector::resize()
ICE"ranges::iterator_t
causes ICE"3287 VSO-1706387 "
<atomic>
: Building a header unit with/ZI
emits warning C5260"source_location::column()
misbehaves in user headers"3330 DevCom-10247495 VSO-1714748 "MSVC forces us to export some internal enumeration functions for working with C++ modules"
3333 VSO-1715231 "Standard Library Modules: Bogus error C2504:
'std::filesystem::_Dir_enum_impl'
: base class undefined"charconv
gives wrong result"using namespace std::chrono;
for UDLs emits bogus error C3688: invalid literal suffix"/analyze
ICE"osyncstream
move assignment emits bogus error C3083:'basic_ostream<char,std::char_traits<char> >'
: the symbol to the left of a'::'
must be a type"sort()
emits bogus error C2065:'_Atomic_counter_t'
: undeclared identifier"chrono
formatting emits bogus error C3861:'_Fill_tm'
: identifier not found"'#include <meow>'
in the purview of module'std'
appears erroneous"tuple
changes"<format>
causes C4296 warning that need to be suppressed every time" (with header units)static constexpr
data members"std::expected
error C2280 attempting to reference a deleted function"std::views::iota
in member function in module causes ICE"std::views::repeat
in member functions gives bogus error about lack ofcompare
header"'...'
: there are no parameter packs available to expand module"numeric_limits
"ctype<char>::table_size
should be a compile-time constant"std::mdspan
is unusable with C++20 modules"std::basic_string_view
symbols""<chrono>
year_month_weekday
andyear_month_weekday_last
emit bogus error C2131: expression did not evaluate to a constant"day{31}
initializers emits 'not yet implemented' internal compiler error"extern "C++"
doesn't avoid all problems when mixing includes and imports"extern "C++"
interferes with ADL"std::filesystem::path::generic_string()
in a module unit"'std'
when constructing and exporting astd::chrono::zoned_time
object"chrono::time_point
formatting emits bogus error C3861:'_Fill_tm'
: identifier not found"utc_clock::now()
emits fatal error C1116: unrecoverable error importing module'std'
."'std'
. Specialization of'std::invoke_result_t'
with arguments'_Fn, _Ty...'
"std::views::zip
withstd::views::iota
in C++20 module results in C1001 Internal compiler error":building_construction: Building Deduplicated Header Units
Here's the part of our Python-powered test harness that builds "deduplicated" header units by topologically sorting them:
https://github.com/microsoft/STL/blob/ef62d3fa0b8e4e2406b9bb74e916e1ca8a1df802/tests/std/tests/P1502R1_standard_library_header_units/custom_format.py#L56-L109
With a bit of work, this can be extracted into a standalone Python script. (With significantly more work, it could be converted into CMake.)