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

            Bug ID: 98642
           Summary: wrong "use of deleted function" error
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

class base {
public:
  base(void) {};
  base(base &&) = delete;
};

class foo : public base {
};

template<typename C>
inline C &bar(void)
{
  static C c{};
  return c;
}

const foo &baz(void)
{
  return bar<const foo>();
}

is rejected since r11-2704 in C++17.  clang++/EDG accept this.

Reply via email to