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

            Bug ID: 89510
           Summary: new_allocator::construct needs to be constrained
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

The construct member has an exception specification which might cause errors
outside the immediate context when trying to determine if the function is
callable.

We should either remove the exception specification (which would be a step
backwards) or should constrain the function using enable_if.

This isn't currently causing issues because we only use the function in
contexts where it's required to work anyway. However, the internal
__is_copy_insertable and __is_move_insertable traits do attempt to check if the
construct() function template is invocable, and so could hit this issue.
Currently we don't use __is_copy_insertable, and only use __is_move_insertable
in contexts where move insertion into std::vector is required to be valid
anyway.

Any other allocators that have a conditional exception specification (including
at least malloc_allocator) need the same change.

Reply via email to