This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/72820] New: std::function can't store types with overloaded operator new


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

            Bug ID: 72820
           Summary: std::function can't store types with overloaded
                    operator new
           Product: gcc
           Version: 6.1.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include <functional>

struct foo {
  void operator()() { }
  static void* operator new(std::size_t, void* p);
};

int main()
{
  std::function<void()> f = foo{};
}

The placement new-expressions in std::function need to use ::new

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]