[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-10-31 Thread andrey.davydov at jetbrains dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #5 from Andrey  ---
Sorry, my fault, spanhttps://eel.is/c++draft/views.span#span.overview-4. It looks strange for me,
but of course, it's not a topic for this tracker.

[Bug libstdc++/103013] Underconstrained constructor span(_Range&&)

2021-10-31 Thread andrey.davydov at jetbrains dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

--- Comment #1 from Andrey  ---
Sorry, the first link to godbolt in the starter message is wrong, it should be
https://gcc.godbolt.org/z/jWeqs6cM4.

[Bug libstdc++/103013] New: Underconstrained constructor span(_Range&&)

2021-10-31 Thread andrey.davydov at jetbrains dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103013

Bug ID: 103013
   Summary: Underconstrained constructor span(_Range&&)
   Product: gcc
   Version: 11.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.davydov at jetbrains dot com
  Target Milestone: ---

During calculation of type trait `is_move_constructible` span constructor
from `_Range &&` is checked and concept `contiguous_range>`
instantiated. It requires T to be complete type
(https://gcc.godbolt.org/z/fYWa3KdTs). It means that
`optional>` couldn't be instantiated
(https://gcc.godbolt.org/z/1PWdE4YK3).

This issue could be solved if make the constructor span(_Range&&) more
constrained, something like this:
template
  requires (!__is_same(_Range, span)) && ...
span(_Range&& __range);

[Bug c++/100065] New: Conditional explicit doesn't work for deduction guide

2021-04-13 Thread andrey.davydov at jetbrains dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100065

Bug ID: 100065
   Summary: Conditional explicit doesn't work for deduction guide
   Product: gcc
   Version: 10.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.davydov at jetbrains dot com
  Target Milestone: ---

#include 

template
struct X
{
template
X(T);
};

template
explicit(b) X(std::bool_constant) -> X;

X false_ = std::false_type{}; // #1 should be OK
X true_  = std::true_type{};  // #2 should fail, but GCC compiles it

Note that other compilers (Clang, MSVC) rejects case #2:
https://gcc.godbolt.org/z/fPEKn1no9