Open StephanTLavavej opened 3 years ago
I am currently seeing 102 unique directories in tests/std
failing when I try to enable EDG concepts (with VS 2022 17.2 Preview 1). 90 of these are tests for P0896R4 (ranges).
EDG is currently tracking 16 remaining issues. As that number falls to 0, we should check the tests again.
Here are issues discovered when compiling the P0896R4_ranges_iterator_machinery
test (all of them are rejects-valid):
:white_check_mark: Reported as VSO-1898880.
Affects _Compile_time_max_size
.
:white_check_mark: Reported as VSO-1898886 (C1XX) and VSO-1898889 (EDG).
Affects ranges::iter_move
in unusual scenarios.
:white_check_mark: Reported as VSO-1898890.
Affects ranges::distance
in unusual scenarios.
Issues discovered when compiling the P0896R4_views_iota
test:
<=>
operator is between the precedence of <
and of ==
. (Should be higher.):white_check_mark: Already reported as VSO-1161828 on 2020-07-24; also DevCom-10156297 on 2022-09-23. Upstream bug is EDGcpfe/23297.
for
loop over lvalue iota_view
is evaluated in a constant expression.:white_check_mark: Reported as VSO-1898908.
P0896R4_views_single
: EDG does not consider single_view<trivially_copy_assignable_type>
to be trivially copy-assignable.
:white_check_mark: Reported as VSO-1898912.
P0896R4_views_common
: Befriending an abbreviated function template makes EDG ignore subsequent members. (This affects difference_type_only_iterator
in the test.)
:white_check_mark: Reported as VSO-1898913.
P0896R4_P1614R2_comparisons
: EDG produces a hard error for can_three_way<bool, int>
.
:white_check_mark: Reported as VSO-1898915.
P0896R4_views_join
: EDG ICE with constant-evaluating std::string
in _DEBUG
mode.
After I added workarounds for these bugs, EDG successfully compiled all the P0896R4*
tests (except that a few tests timed out). It still fails for P2374R4_views_cartesian_product
, P2441R2_views_join_with
, and maybe others, which I haven't investigated, but in general, the support seems good enough.
test_mdspan_support.hpp
: EDG needs typename
in the parameter list of a requires-expression.
:white_check_mark: Already reported as DevCom-10436970 VSO-1868335 on 2023-08-09.
P0323R12_expected
: EDG rejects requires-clause in a definition within a function template.
:white_check_mark: Reported as VSO-1898929.
P2474R2_views_repeat
: EDG rejects parenthesized aggregate initialization in a mem-initializer.
:white_check_mark: Reported as VSO-1898933.
P0009R18_mdspan_default_accessor
: EDG constexpr dynamic allocations can't handle an array of std::string
in debug mode
:white_check_mark: Reported as VSO-1898962.
P2322R6_ranges_alg_fold
: failure with vector
in _DEBUG
mode.
__is_convertible_to
depends on whether the private members can be accessed in the current context.:white_check_mark: Reported as VSO-1898937.
constructible_from
has wrong value.:white_check_mark: Reported as VSO-1898939.
default_initializable<const T>
has wrong value.:white_check_mark: Reported as VSO-1898941.
default_initializable<AggregatesExplicitDefault>
has wrong value.:white_check_mark: Reported as VSO-1898944 (C1XX) and VSO-1898945 (EDG).
std::nullptr_t
has relational operators, but it should not. (Affects both totally_ordered
and totally_ordered_with
.):white_check_mark: Reported as VSO-1898947.
Thank you!!! :heart_eyes_cat: I've reported 19 bugs (slightly cleaning up some repros) and semi-reduced 2 more.
noexcept
defaulted default constructor.:white_check_mark: Reported as VSO-1900276.
:white_check_mark: Reported as VSO-1900278.
P2165R4_tuple_like_common_type
: Conditional explicit specifier is checked too early in constrained constructor.
:white_check_mark: Reported as VSO-1900279.
P2165R4_tuple_like_operations
: Variable template is instantiated too early.
:white_check_mark: Reported as VSO-1900281.
Dev11_0437519_container_requirements
: EDG thinks a member does not exist when:
:white_check_mark: Reported as VSO-1900290.
This is unrelated to concepts. Why didn't this test fail before C++20? 🤔
P2278R4_views_as_const
:
:x: @StephanTLavavej can't repro with VS 2022 17.8 Preview 3 x64, or prod/fe x86chk on 2023-10-11.
:white_check_mark: Reported as VSO-1900291.
P2374R4_views_cartesian_product
:
:white_check_mark: Reported as VSO-1900292.
:white_check_mark: Reported as VSO-1900293.
P2441R2_views_join_with
: Constrained default constructor causes problems.
:white_check_mark: Reported as VSO-1900294.
P0898R3_concepts
: EDG thinks that conditional-expression has function type when it should have reference-to-function type.
:white_check_mark: Reported as VSO-1900296.
These should be all.
And here are tentative workarounds for all these bugs.
:heart_eyes_cat: Thanks again!! I reported 10 more bugs (I had to fix a few repros, e.g. one said rank_dynamic
instead of actually calling rank_dynamic()
, another was using a Clang intrinsic __is_same
but I file bugs with MSVC vs. EDG comparisons so I had to extract is_same_v
, and another assumed your modified <concepts>
so I extracted the relevant machinery).
However, I was completely unable to reproduce one bug, noted above with :x:. Can you double-check that one?
EDG on godbolt fails to compile the LLVM-62096 test case, but cl /BE
works. Maybe it's actually a different bug.
Actually cl /BE
rejects this, reduced from P2278R4_views_as_const
:
:white_check_mark: Reported as VSO-1901430.
- VSO-1900291 EDGcpfe/26751 EDG ICE involving pointer arithmetic
- EDG can repro a spurious error here, but not the ICE that repros in VS. They hope that it's the same underlying issue.
The ICE still exists in 17.9 Preview 2. Also note that the reduced test case makes EDG eccp (on godbolt.org) segfault: https://godbolt.org/z/Ys3rd1c8f.
- VSO-1900292 EDG fails to handle a requires-clause that involves a local type alias
This is fixed, but now EDG produces a wrong value for such a requires-clause (false
when it should be true
):
template<class T>
constexpr bool always_true = true;
template <class T, bool = always_true<T>>
constexpr int bit_width(T) { return 1; }
template<class T>
constexpr int max_size = 1;
template<class T>
constexpr int get_max_size() {
using S = decltype(max_size<T>);
if constexpr (requires(S val) { ::bit_width(val); }) {
return ::bit_width(max_size<T>);
} else {
return -1;
}
}
static_assert(get_max_size<int>() == 1); // error: static assertion failed
VSO-1900291 EDGcpfe/26751 EDG ICE involving pointer arithmetic
- EDG can repro a spurious error here, but not the ICE that repros in VS. They hope that it's the same underlying issue.
The ICE still exists in 17.9 Preview 2. Also note that the reduced test case makes EDG eccp (on godbolt.org) segfault: https://godbolt.org/z/Ys3rd1c8f.
I can still repro this with the most-recent compiler drop we got from the Edge team in early January, which AFAIK should contain the fix. I've poked VSO-1900291 and asked them to reverify that it is fixed.
I can still repro this with the most-recent compiler drop we got from the Edge team in early January, which AFAIK should contain the fix. I've poked VSO-1900291 and asked them to reverify that it is fixed.
The Edge team investigated and determined that they sent the wrong repro to EDG for VSO-1900291. They have reactivated the bug and are trying again =)
generator
: EDG instantiates the wrong overload of promise_type::operator new
.
Thanks for extracting these repros! :heart_eyes_cat:
I've further reduced and reported VSO-1951794 "EDG produces a wrong value for a requires-clause that involves a local type alias".
I've also reported VSO-1951821 "EDG instantiates the wrong overload of promise_type::operator new
for generator
machinery". Both are recorded in the list above.
This was originally limited to tracking EDG concepts bugs, but is now unlimited.
:sos: Modules (including Header Units)
There are an unknown number of blocking issues for EDG consuming header units and named modules. Currently, EDG coverage is disabled in the header units test, and hasn't been added to the named modules test:
Click to expand env.lst files:
https://github.com/microsoft/STL/blob/a26f4adb1ecf767784bb4e4318093c4579fdb364/tests/std/tests/P1502R1_standard_library_header_units/env.lst#L18-L22 https://github.com/microsoft/STL/blob/a26f4adb1ecf767784bb4e4318093c4579fdb364/tests/std/tests/modules_20_matrix.lst#L18-L20Help wanted: EDG is looking into the issues with header units, but we can accelerate this work by investigating, reducing, and reporting individual issues.
:white_check_mark: Reported Upstream
<=>
decltype
can't deduce typesingle_view<trivially_copy_assignable_type>
to be trivially copy-assignablecan_three_way<bool, int>
__is_convertible_to
depends on whether the private members can be accessed in the current contextdefault_initializable<const T>
has wrong valuedefault_initializable<AggregatesExplicitDefault>
has wrong value__is_constructible
has wrong valuestd::nullptr_t
has relational operators, but it should notconstexpr
dynamic allocations can't handle an array ofstd::string
in debug modeexplicit
specifier is checked too early in constrained constructornoexcept
with friendshipas_const_view
with error: atomic constraint depends on itselfstd::expected
trying to propagate triviality of assignment operationspromise_type::operator new
forgenerator
machineryconversion_for_direct_reference_binding_possible
std::is_empty
(__is_empty
) properly for potentially-overlapping member subobjectscpfe.dll!make_coroutine_result_expression
with C++23<generator>
test:tada: Fixed
noexcept
defaulted default constructorfor
loop over lvalueiota_view
is evaluated in a constant expressionconstexpr std::string
in aunion
P0896R4_views_join
still can't be removed, we need to reduce and report againstatic_assert(false)
usablestd::num_get
:mirror: C1XX Counterparts
default_initializable<AggregatesExplicitDefault>
has wrong value