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

            Bug ID: 93562
           Summary: [10 Regression] unique_ptr::swap requires complete
                    type
           Product: gcc
           Version: 10.0
            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 bar;

struct foo {
  foo();
  ~foo();

  void swap(foo& f) noexcept {
    up.swap(f.up); // same error for std::swap(up, f.up)
  }

  std::unique_ptr<bar> up;
};


/home/jwakely/gcc/10/include/c++/10.0.1/bits/unique_ptr.h:79:16: error: invalid
application of 'sizeof' to incomplete type 'bar'
   79 |  static_assert(sizeof(_Tp)>0,
      |                ^~~~~~~~~~~

Reply via email to