You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code fails on libc++ but works with other implementations:
#include<span>structBar;
voidfoo(std::span<Bar> a) {
std::span<Bar> b(a);
}
The problem seems to be that we try testing for the range-based constructor of span, which hard-errors because we are checking the contiguous_range constraint and end up performing arithmetic on a pointer to an incomplete type.
Trying to copy-construct a std::span from another std::span holding
an incomplete type would fail as we evaluate the SFINAE for the
range-based constructor. The problem was that we checked for
__is_std_span after checking for the range being a contiguous_range,
which hard-errored because of arithmetic on a pointer to incomplete
type.
As a drive-by, refactor the whole test and format it.
Fixesllvm#104496
Trying to copy-construct a std::span from another std::span holding an
incomplete type would fail as we evaluate the SFINAE for the range-based
constructor. The problem was that we checked for __is_std_span after
checking for the range being a contiguous_range, which hard-errored
because of arithmetic on a pointer to incomplete type.
As a drive-by, refactor the whole test and format it.
Fixesllvm#104496
(cherry picked from commit 99696b3)
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Aug 19, 2024
Trying to copy-construct a std::span from another std::span holding an
incomplete type would fail as we evaluate the SFINAE for the range-based
constructor. The problem was that we checked for __is_std_span after
checking for the range being a contiguous_range, which hard-errored
because of arithmetic on a pointer to incomplete type.
As a drive-by, refactor the whole test and format it.
Fixesllvm#104496
(cherry picked from commit 99696b3)
The following code fails on libc++ but works with other implementations:
The problem seems to be that we try testing for the range-based constructor of span, which hard-errors because we are checking the
contiguous_range
constraint and end up performing arithmetic on a pointer to an incomplete type.Repro: https://godbolt.org/z/ox6dajefE
The text was updated successfully, but these errors were encountered: