This issue tracks /clr compiler bugs that we need fixes for.
/clr /std:c++20 was first supported (excluding modules) in VS 2022 17.6.
Legend
- 📦 Not reduced, preprocessed repro
- 😸 Semi-reduced, pruned unnecessary test code
- 💚 Fully reduced, library-free repro
Product Code Workarounds
- 💚 VSO-1153256 Issue:
[[msvc::noop_dtor]] doesn't seem to work for /clr
- 😸 VSO-1663104
/clr rejects the __ceilf/__floorf intrinsics with error LNK2020/LNK2001 instead of accepting or falling back to native codegen
- 📦 VSO-1665606
/clr C++20 backend ICE with counted_iterator's _Same_sequence
- 😸 VSO-2457624
/clr /std:c++20 silent bad codegen with the __fastfail intrinsic
Test Code Workarounds
- 😸 VSO-1659383
/clr atomic and thread emit error C2711 "this function cannot be compiled as managed" instead of falling back to native codegen
- 😸 VSO-1659496
/clr emits bogus error C2079 "uses undefined struct 'Incomplete'" despite std::variant's ADL defenses
- 😸 VSO-1659511
/clr runtime hang when calling std::async in a global variable's constructor
- 😸 VSO-1664341
/clr C++20 System.NullReferenceException when calling ranges algorithms with PMD projections
- 📦 VSO-1664382
/clr C++20 emits bogus error C2127 "illegal initialization of 'constinit' entity with a non-constant expression"
- 💚 VSO-1665481
/clr C++20 silent bad codegen for complex<float> division
- 📦 VSO-1665670
/clr C++20 incorrectly reports input_iterator etc. concepts as being true for 'bad' iterators
- 📦 VSO-1665674
/clr C++20 has incorrect results for various ranges concepts in P0896R4_ranges_iterator_machinery
- 😸 VSO-1666161
/clr C++20 silent bad codegen for bit_cast<float>(nan_uint)
- 💚 VSO-1666178
/clr C++20 x64 /O2 backend assertion SY_ISUSERVAR(sym) || SY_ISARGUMENT(sym)
- 💚 VSO-1846195
/clr alignas emits fatal error C1193: an error expected in yyaction.cpp(2971) not reached
- 😸 VSO-1946395
/clr /std:c++20 /Od backend ICE for parallel std::find_end
No Workarounds
- 💚 VSO-1459687 DevCom-1632617 C++/CLI struct/class doesn't use
MarshalCopy
- 💚 VSO-2231268
/clr /std:c++20 rejects sneaky technique to access private data members
- 💚 VSO-2279389
/clr C++20 can't handle struct MoveOnlyFunctor defined in a function template, emitting fatal error C1193: an error expected in yyaction.cpp(2899) not reached
- 💚 VSO-2616030
/clr /std:c++20 alignas emits bogus error C3645: 'main::<lambda_1>::<lambda_invoker_clrcall>': __clrcall cannot be used on functions compiled to native code
Fixed
- VSO-1078742 DevCom-939490 Calling a pointer to member function at
constexpr time in /clr triggers internal compiler error
- VSO-1663233
/clr C++20 rejects <coroutine> with error C3861 "'__builtin_coro_done': identifier not found" instead of falling back to native codegen
- VSO-1680392 Assertion failure:
pSTI->length == strlen(pSTI->szName) + 1 under /clr
- VSO-1595465
/clr /std:c++17 ICE with int = 0 SFINAE
- VSO-1663257
/clr C++20 rejects P0428R2 Familiar template syntax for generic lambdas
- VSO-1663301
/clr C++20 emits bogus error C2131 'expression did not evaluate to a constant' when a lambda tests a constexpr variable defined outside
- VSO-1665663
/clr C++20 source_location has incorrect column information within a lambda
- VSO-1664463
/clr C++20 alignas emits error C3821 'managed type or function cannot be used in an unmanaged function' instead of falling back to native codegen
- VSO-1659408
/clr alignas emits error C2711 "this function cannot be compiled as managed" instead of falling back to native codegen
- VSO-1666180
/clr C++20 x64 System.AccessViolationException with views::iota and views::transform
- Duplicate: VSO-1659489
/clr System.AccessViolationException with parallel std::mismatch
- Duplicate: VSO-1867037
/clr C++20 System.AccessViolationException with ranges uninitialized algorithms
- VSO-1665654
/clr C++20 x86 System.AccessViolationException with atomic<shared_ptr>
- VSO-1659695
/clr x86 runtime assertions/crashes with parallel algorithms
- VSO-1658184
/clr silent bad codegen with std::_Signed128 multiplication
- VSO-1881472
/clr C++20 x86 System.AccessViolationException with atomic<with_padding_bits<8>>
- VSO-1664293
/clr C++20 chk assertion failed: rhs.is_lvalue() in constexpr.cpp
- VSO-2417635
/clr C++20 chk assertion failed: rhs.is_lvalue() in constexpr.cpp, again
This issue tracks
/clrcompiler bugs that we need fixes for./clr /std:c++20was first supported (excluding modules) in VS 2022 17.6.Legend
Product Code Workarounds
[[msvc::noop_dtor]]doesn't seem to work for/clr/clrrejects the__ceilf/__floorfintrinsics with error LNK2020/LNK2001 instead of accepting or falling back to native codegen/clrC++20 backend ICE withcounted_iterator's_Same_sequence/clr /std:c++20silent bad codegen with the__fastfailintrinsicTest Code Workarounds
/clratomicandthreademit error C2711 "this function cannot be compiled as managed" instead of falling back to native codegen/clremits bogus error C2079 "uses undefined struct 'Incomplete'" despitestd::variant's ADL defenses/clrruntime hang when callingstd::asyncin a global variable's constructor/clrC++20 System.NullReferenceException when calling ranges algorithms with PMD projections/clrC++20 emits bogus error C2127 "illegal initialization of 'constinit' entity with a non-constant expression"/clrC++20 silent bad codegen forcomplex<float>division/clrC++20 incorrectly reportsinput_iteratoretc. concepts as being true for 'bad' iterators/clrC++20 has incorrect results for various ranges concepts inP0896R4_ranges_iterator_machinery/clrC++20 silent bad codegen forbit_cast<float>(nan_uint)/clrC++20 x64/O2backend assertionSY_ISUSERVAR(sym) || SY_ISARGUMENT(sym)/clralignasemits fatal error C1193: an error expected in yyaction.cpp(2971) not reached/clr /std:c++20 /Odbackend ICE for parallelstd::find_endNo Workarounds
MarshalCopy/clr /std:c++20rejects sneaky technique to access private data members<chrono>: Add comments for compiler bug workarounds #4920./clrC++20 can't handlestruct MoveOnlyFunctordefined in a function template, emitting fatal error C1193: an error expected in yyaction.cpp(2899) not reached<future>: Makepackaged_taskaccept move-only functors #4946./clr /std:c++20alignasemits bogus error C3645:'main::<lambda_1>::<lambda_invoker_clrcall>':__clrcallcannot be used on functions compiled to native code<__msvc_threads_core.hpp>: Use aligned byte arrays as aligned buffers #5811.Fixed
constexprtime in/clrtriggers internal compiler error/clrC++20 rejects<coroutine>with error C3861 "'__builtin_coro_done': identifier not found" instead of falling back to native codegenpSTI->length == strlen(pSTI->szName) + 1under/clr/clr/std:c++17ICE withint = 0SFINAE/clrC++20 rejects P0428R2 Familiar template syntax for generic lambdas/clrC++20 emits bogus error C2131 'expression did not evaluate to a constant' when a lambda tests aconstexprvariable defined outside/clrC++20source_locationhas incorrect column information within a lambda/clrC++20alignasemits error C3821 'managed type or function cannot be used in an unmanaged function' instead of falling back to native codegen/clralignasemits error C2711 "this function cannot be compiled as managed" instead of falling back to native codegen/clrC++20 x64 System.AccessViolationException withviews::iotaandviews::transform/clrSystem.AccessViolationException with parallelstd::mismatch/clrC++20 System.AccessViolationException with ranges uninitialized algorithms/clrC++20 x86 System.AccessViolationException withatomic<shared_ptr>/clrx86 runtime assertions/crashes with parallel algorithms/clrsilent bad codegen withstd::_Signed128multiplication/clrC++20 x86 System.AccessViolationException withatomic<with_padding_bits<8>>/clrC++20 chk assertion failed:rhs.is_lvalue()in constexpr.cpp/clrC++20 chk assertion failed:rhs.is_lvalue()in constexpr.cpp, again