Skip to content

[libc++] Invalid copy-construction from span<Incomplete> #104496

Closed
@ldionne

Description

@ldionne

The following code fails on libc++ but works with other implementations:

#include <span>

struct Bar;

void foo(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.

Repro: https://godbolt.org/z/ox6dajefE

Metadata

Metadata

Assignees

Labels

libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions