https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126120

            Bug ID: 126120
           Summary: is_constructible_v with shared_ptr from a non-movable
                    object
           Product: gcc
           Version: 16.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asdfsddf1 at outlook dot com
  Target Milestone: ---

Created attachment 64943
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64943&action=edit
The reproduce code, compiled with C++17

According to the Constraints in [util.smartptr.shared.const], d(p) must be a
well-formed expression. Since NonDeleter has no callable operator(), the
constraint is not satisfied, so these constructors should not participate in
overload resolution.

Behavior is correct when manually constructed shared_ptrs.

Compiler Explorer link: https://godbolt.org/z/TWr5odjcb

Reply via email to