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

            Bug ID: 79467
           Summary: [7 Regression] incorrect static assertion in
                    shared_ptr
           Product: gcc
           Version: 7.0.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 <memory>

struct X { };

struct D {
  void operator()(X*&) {}
};
std::shared_ptr<X> p(new X(), D());

Fails on trunk with:

/home/jwakely/gcc/7/include/c++/7.0.1/bits/shared_ptr_base.h:1088:4: error:
static assertion failed: deleter expression d(p) is well-formed
    static_assert(__is_callable<_Deleter(_Yp*)>::value,


The __is_callable expression should be using lvalues not rvalues.

Reply via email to